Fixing the Ability to edit iPhone Images Imported to Windows

If you’ve been plagued by the following errors ever since upgrading to iOS5:

This photo can't be saved because of a problem with the photo's file properties.
This photo can’t be saved because of a problem with the photo’s file properties.
Photo Gallery couldn't update this file: Error code: (0x80070057)
Photo Gallery couldn’t update this file: Error code: (0x80070057)

Fret no more, relief is here!

After much investigation the root cause is erroneous white-space characters in the XMP block of the image files. 

The first step to fixing this problem is to

Stop taking pictures with the volume button!

No, this is not a solution but the problem seems to happen more frequently for images taken with the volume up button than images take win the shutter release on-screen button. Therefor, avoiding the volume button seems like a good idea. Next,

Fix the Images which already have the issue!

Lots of work-arounds have been posted for when you discover the problem when editing a particular image, however; the issue may surface down the road on images you have not previously edited. For me, fixing the issue only on the images I attempted to edit was not a good solution. I wanted an all-or-nothing fix.

I’ve written a small Java utility which will scan over an entire directory (or a directory of directories, or a directory of directories of directories, etc) and fix the issue on any images which have it.  The full source code is available on Google Code (yes I still live in 2009, but at least it’s using mercurial). It will not touch images which do not have the issue.

Download jpegxmpxmltrimmer

As of this post the current version is 0.01 which essentially means:

It’s pre-production, pre-release, pre-beta, pre-alpha, pre-warranty, you-get-what-you-pay-for. /disclaimer

Run jpegxmpxmltrimmer

Assuming you already have a Java JRE installed, bring up a command prompt and enter the following command:

NOTE: This command will not edit existing files.  This is the safe mechanism to fixing your images.  Rather than fixing the originals, it makes copies and fixes the copies (named appropriately).

java -jar <path-to-downloaded-jpegxmpxmltrimmer.jar> <path-to-root-directory-of-images>

If you would like to fix the error by editing the existing files simply add a true at the end of the commandline.

That’s it.  You’ve now fixed the issue!  Yay! <insert-mini-celebration-here/>

The Catch

You’ve fixed the images with the pre-existing issue, but the bug still exists in the latest release of iOS (5.1 as of this post).

For now, you’ll have to run the utility over any files you import.  I’ve still found the issue on a few photos I’ve imported even since I stopped using the volume button.

I’ve reported the issue to Apple but haven’t yet heard back.  If you want this issue fixed permanently I suggest you do the same:

The Solution is Simple at 350 ppm

The web is abuzz today with two things. One, Amazon.com has been down for hours. Two, the story of Alain Robert (aka spidey) and Renaldo Clarke who both climbed the 52-story New York Times Building.

Renaldo Clarke climbed to draw attention to childhood malaria.

Alain Robert climbed to draw attention global warming and was carrying a banner which stated:

Global Warming kills more people than 9/11 every week.

I took the bait. I don’t have a clue how something like that could even be measured, but his banner alone isn’t why I wanted to look into this guy. I don’t think it’s shocking news that I’m somewhat interested in the developments of Global Climate Change. I like to see what new stuff is happening and what different movements there are. Perhaps one day I’ll even find one that I feel I can contribute to, who knows?

Alain’s T-shirt during the stunt read “The Solution Is Simple .org“.  While I thought this would be nothing more than another meaningless organization that asks you to buy coupons to offset your carbon emissions The Solution Is Simple turns out to be Alain’s personal website and it appears he is very much in the midst of the whole Green Shift. The notion of “Greener is Better” really seems to resonate with this guy.

I have a lot of respect for Alain Robert. It seems everything this guy does has something to do with going Green and he really walks the walk. His site is even hosted by a green company.

Something I found on The Solution Is Simple mentioned twice interested me. 350. As it turns out there is an organization claiming that 350 parts per million is the magical amount of CO2 in the atmosphere which we need.

350 is the red line for human beings, the most important number on the planet. The most recent science tells us that unless we can reduce the amount of carbon dioxide in the atmosphere to 350 parts per million, we will cause huge and irreversible damage to the earth.

I’m not sure if this is the magic number or not but it’s something to strive for I suppose. At least it puts a goal in mind rather than just the blanket statement most organizations seem to make of “we need to be greener.”

With his stunt and his website Alain is urging everyone to send a message about global warming to world leaders who are meeting next month at the G8 conference in Japan. You should too. There is a simple form you can fill out to do so on his website The Solution Is Simple.

I’m Randy Aldrich and I Approve this message.

NOTE: I am simply pointing out organizations and companies which have claims to being ‘green.’ I have in no way verified the validity of these statements.  Please let me know if you find anything different.