iPhoto: Reclaim Your Memory!
23 Jan 2011 00:45
23 Jan 2011 00:45
23 Jan 2011 00:45
23 Jan 2011 00:45
nav_first.pngFirst: blog:1
My first blog!
Edited: 06 Nov 2011 11:49 by: James Kanjo
Comments: 2
Tags: ads blog css facebook first free myspace program programming wiki wikidot
nav_prev.pngPrevious: blog:68
Wikidot: Descendant Database
Edited: 06 Nov 2011 11:55 by: James Kanjo
Comments: 0
Tags: family programming wikidot
Last: blog:77
Wikidot: CSS Per Category
Edited: 04 Mar 2012 05:54 by: James Kanjo
Comments: 3
Tags: programming wikidot
Next: blog:70
Barcodes: An Exciting New Language!
Edited: 22 Feb 2012 08:46 by: James Kanjo
Comments: 3
Tags: barcode generator javascript programming

As a Mac user, iPhoto is a regularly used application. It's fantastic for easy photo editing, and beautifully organises your photos. Personally, I love the face recognition technology.

However, as your photo collection grows, so does the database size. So if your looking for ways to free up your hard drive space, iPhoto is a great place to start.

“NOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!” I hear you cry… “I don't want to delete any of my photos!!!!!!”

That's the best part about this neat trick. You don't have to! You can save gigabytes of memory without deleting any photos. And here's why.

As I previously mentioned, iPhoto makes editing photos easy. REALLY easy. And any changes you make to a photo are completely reversible… that is, if you make a mistake, iPhoto retains a copy of the original photo so you can start again from scratch.

But once you've finished editing a photo, do you really need to retain an original photo that you will never see? Not really.

Also, it is quite often that one takes a photo with their camera in a portrait position… so when you upload it on the computer, the photo is sideways. iPhoto makes it easy to rotate images the right-way-up — but even a small change such as image rotation is considered an edit, so iPhoto creates a copy of the original sideways photo.

Do you really need to retain a sideways photo that you will never see? Not really.

Warning! This technique should only be attempted by advanced computer users! Proceed with caution.
That is, follow each instruction, word-for-word.

So here's a Terminal trick that will remove those unnecessary unseen “originals” from your iPhoto library. This code is my own derivative of this Macworld hint. Firstly, open up the Terminal application. Type in the following lines of code, followed by “enter” after each.

mkdir ~/.Trash/iPhoto-Originals

cd ~/"Pictures/iPhoto Library/Modified/"

find . -type f -exec mv "../Originals/{}" ~/.Trash/iPhoto-Originals/ \;

cp -R -n ./* ../Originals/

rm -r ~/"Pictures/iPhoto Library/Modified/"

killall Terminal

After the terminal is finished (I have a library of 4,520 photos, and it took about 4mins), I recommend that you go to the Trash can, select the “iPhoto-Originals” folder and find out it's size. This is how much memory you have freed your computer from (after you empty the trash can of course!). I saved 3GB with this trick.

However, we're not finished yet!

  1. Open iPhoto
  2. Select the “Photos” from the “library” (i.e. read carefully, it's “Photos”, not “Events”, “Faces” or “Places”)
  3. Click command+A (select all photos)
  4. Right-click the selection and click “Revert to Original” (and click “OK” to confirm this action)

This will fix a problem where your modified images magically disappear. Now repair any database corruption that may be present:

  1. Quit iPhoto
  2. Start iPhoto whilst holding down command+option(alt)
  3. Tick all boxes to rebuild library EXCEPT “Rebuild the iPhoto Library Database from automatic backup”
  4. Click “Rebuild”

Congratulations! You're done!

How it works

The iPhoto database has two significant folders inside it:

  • Originals
  • Modified

All photos are stored in the “Originals” folder at first. If you edit any photo, iPhoto stores the edited version in the “Modified” folder, and retains the untouched original in the “Originals” folder.

What the above code does is it that it finds all of the photos in the “Modified” folder, and for each photo it finds the original version in the “Originals” folder and moves it to the trash. Too simple.

You should find that this also essentially optimises the speed of the iPhoto application, as it no longer wastes time locating “original” images.

λ James Kanjo


Add a New Comment
or Sign in as Wikidot user
(will not be published)
- +
All content on this page is subject to the guidelines outlined here