Starfleet XP

  • Don: Here's one for you:
  • Don: Do Starfleet officers get paid for their service?
  • Mike: No, they do not.
  • Mike: They do it for the lulz*
  • Mike: *maybe
  • Don: So does that mean earth is devoid of currency in the future?
  • Mike: Yes, it is.
  • Mike: It's a post-scarcity economy, where nobody has to buy anything because they replicate everything
  • Mike: I still don't understand how they allocate land, though.
  • Mike: That's a finite resource.
  • Don: So poverty is eradicated?
  • Mike: Yep.
  • Don: And is everyone in the star trek universe of very high IQ?
  • Mike: I don't think so.
  • Don: Not one person they encounter appears to be retarded or stupid.
  • Mike: Presumably the same distribution as nowadays
  • Mike: Maybe they mash up the thickos for spare parts for the smarts?
  • Don: Even the non starfleet trained individuals appear to be able to override security protocols etc.
  • Mike: Yeah, there does seem to be a preponderence of mad skillz
  • Don: Either that or the OS on their systems is ridiculously insecure.
  • Mike: Windows in the 24th century?
  • Don: LOL
  • Don: Windows 30?
  • Don: Nahhhhh, bet it's still XP. Some higher up in SF is used to it so he doesn't want it changed.

Findings 01

  • “Next up, a cure for cancer.” — ubercurmudgeon [Ars Technica]
  • In 1937, F. Scott Fitzgerald made the equivalent of $485,894.64 [Wikipedia+Wolfram-Alpha]
  • “Tracing The Office's Rise From Midseason Also-Ran to Nine-Season Behemoth” [A. V. Club]
  • How to import .eml files into a Maildir [Paul Sinnet’s Blog]
  • “You’ve managed to go a thousand centuries without your head getting crushed under the back wheels of a bus. Kudos.” — Sahasrahla [reddit]

Lossless iPhoto Compression

We live in an age of exceptionally cheap storage. Right now, I can buy an external hard-disk 2TB in size for £70. As such, storing a large amount of almost any kind of file isn’t really an issue.

In light of that fact, running any sort of optimisation that results in savings of less than one percent of your total hard-disk size might seem unnecessary. It probably is unnecessary, but having grown up with computers where the hard-disks were initially measured in the tens of megabytes, I haven’t quite been able to shake the feeling that every byte that can be saved should be saved. (It’s likely there’s also a certain element of technical vanity involved too.)

One of the ‘easy’ targets of this optimising impulse was my iPhoto library. Using jpegoptim, it’s possible to reduce the file-size of images without any loss in quality.

My iPhoto library started 14.3GB in size,1 and seemed like it could benefit from a little optimisation. It also seemed easier than trying to sort through them. As with all endeavours like this, it also offered a great opportunity to learn a bit more about using a cornerstone *nix tool — in this case, find.

How to Do It

Before You Even Think About Starting

The optimisation process itself is lossless — file-size savings come from re-organising the Huffman tables within the images rather than reducing their quality, but you need to make sure you have at least one known-good backup of your iPhoto/Aperture library before proceeding.

This command shouldn’t result in any data loss, but it does overwrite the original images with the new, optimised copies, so there is the potential for data loss.

So, before going any further, make sure you have at least one backup because I accept absolutely no responsibility if this backfires horribly and wipes out your photo library/ies. You do this at your own risk.

Also, make sure you don’t have iPhoto or Aperture running when you carry out the optimisation. It probably won’t cause any problems, but I’m not sure, and it seems sensible not to have it accessing the photos as you’re attempting to optimise them.


Now that you’ve got a known-good backup in place, you’ll need the following two tools:

Where You Need to Be

To optimise your iPhoto library — and only your iPhoto library — you need to be inside its bundle. (If you run with from the root of your home directory, you’ll optimise every image it comes across in there.)

Assuming you have your library in the default location, this is really straight-forward: just cd into it, like so:

cd ~/Pictures/iPhoto\ Library/

(For your Aperture library, just type Aperture instead of iPhoto. If you wanted to carry out the same optimisation on photos in your Dropbox, cd into it and run the command — it’s designed to be ‘location agnostic’.)

The Command Itself

Now that you’re in your iPhoto library, simply type the following command into your shell and hit enter:

find . -iname '*.jp*' -exec jpegoptim -opv {} \;

The command contains several parts:

  • find . -iname '*.jp*'

    This part invokes find to recursively locate files within the current directory (and its subdirectories) of any name (the first ‘*’) with extensions beginning ‘jp’, which means find will pick up both .jpg and .jpeg files.2

  • -exec

    This simply tells find to pass any matching files to the following command.

  • jpegoptim -opv {} \;

    This invokes jpegoptim to optimise the images. The following flags (o, p, and v) tell jpegoptim to carry out the following actions on the images it’s processing:

    • o - overwrite original image with the new, optimised image;
    • p - preserves file modification and creation dates;
    • v - verbose, so reports after each file is optimised, and by how much.3

    The trailing ‘{} \;' is required by the find command to operate correctly on the images being passed to jpegoptim: {} is replaced by the filename, and the \; is the escaped terminating ; character, required to tell find there are no more commands to be executed.

The command itself can take anything for several seconds to several hours to run, depending how many photos it finds. You can keep working on other things whilst it does it, though your Mac might get a little warm on the bottom as it’s working, and your hard-disk will be active almost constantly.

The End Results

My iPhoto library:

  • Size before: 14.30GB
  • Size after: 13.69GB
  • Size saving: 0.61GB
  • Percentage saving: 4.27%

A friend of mine is a much more enthusiastic photographer than I; the combined size of his iPhoto and Aperture libraries was 41.72GB without any optimisation.4

The results of his optimisation:

  • Size before: 41.72GB
  • Size after: 40.70GB
  • Size saving: 1.02GB
  • Percentage saving: 2.44%


I can’t explain why Iain’s optimisation, on a percentage basis, was less successful than mine. The best idea I have is that some cameras produce more optimised photos than others; Iain’s photos were taken with better cameras than mine, so it’s possible that higher-end equipment does a better job of optimising the photos on the fly.

Purely in terms of space saved, it probably isn’t worth it unless you’re on a relatively small SSD where each gigabyte saved represents a more substantial percentage of your total storage. If, like me, you’re constantly battling to find more space, then it also becomes worth it, especially if you have a truly massive library. And the final benefit is that it reduces the upload time and space used if you backup or sync your library to your Dropbox, where space is definitely at a premium.

  1. As reported by Mac OS X’s Finder. I’m still not 100% comfortable with the Gibibyte/Gigabyte difference, and don’t really care enough to invest the time in understanding the finer points of the distinction. 

  2. If you don’t trust this command, the other alternative is to run the command twice, first with *.jpg, then with *.jpeg

  3. This is actually of pretty limited usefulness because of the sheer speed at which any reasonably fast Mac will optimise images, but it does give a visual indicator that the process is ongoing, and you can also direct the output into a log file by appending > jpegoptim-log.txt after the \;

  4. Iain’s libraries contain a mixture of JPEG and RAW files, so to make it a like-for-like comparison, we subtracted the combined size of all the RAW files from the totals and compared those. 


  • Ruairidh: I found some early electro stuff I did in 2001 the other day, some of it isn't that shit.
  • Mike: What kind of electro did you produce?
  • Ruairidh: Some of it is drumless with delta blues samples, I just tried to get loops that blended nicely, apart from the terrible gabbaesque 300bpm ones.
  • Mike: Eek. Gabba is never, ever a good idea. I presume you were under the influence of something when you decided to contribute to that abortion of a genre?
  • Ruairidh: Gabba was influenced by using a visual synth that converted paint drawings into sounds, stone cold sober!
  • Mike: I find your clearly fictional origin story unconvincing!
  • Ruairidh: Ketamine?
  • Mike: That has the ring of truth to it! I'd also accept that you were trying to make a Dutch girl feel at home and thus comfortable enough to remove her clothes.

The Game of Thrones

  • Don: Daenerys is dating Seth Macfarlane?!
  • Mike: lul wut
  • Don: Just looked at the page about her on Wikipedia and apparently it's been reported they're dating.
  • Don: I knew there was a reason I thought he was a fucking prick.
  • Mike: When you play the game of thrones, you win or you die (of a broken heart).
  • Don: Nobody ever seems to win The Game of Thrones.
  • Mike: Seth Macfarlane obviously has. Probably several times every night.