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:

10 thoughts on “Fixing the Ability to edit iPhone Images Imported to Windows

  1. I was getting the “You cannot rotate this image…” error in Windows 7 64-bit Windows Explorer.
    I dl’ed the above jar, and saved it to the Java folder in program files.
    I ran:”java -jar c:Program FilesJavajpegxmpxmltrimmer.jar c: true”
    Nothing has changed. Did I do something wrong?

    Like

    1. Did you get any output?

      It looks like you’re attempting to run it over your entire c drive. I have not tested this, it may run into issues when scanning directories that are secured or otherwise protected by windows.

      I would suggest pointing it at the directory that contains your images.

      Like

  2. I’m not sure what you mean by “output”. By appending the instruction with “true”, the files are edited so there are no additional files as output, right?
    A black run box blipped very briefly on the screen and then… nothing.

    Like

  3. Thanks so much for this. It is sad to me that Apple can’t fix this when the solution seems so trivial. Thanks again!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s