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:

Decoding Nested gz base64 code

Whenever I first install any theme, I make my own modifications.  Sometimes  it’s removing extraneous code that I won’t be using, or changing the size of certain sections, or adding in some calls that I do need.  Whenever I do this I always modify the footer to say ‘Modified by Randy Aldrich.’

Recently After modifying the theme to my liking I went to add my own footer only to find the Author had used gz compression and base64 encoding on the footer.  All I found was the following code:

eval(gzinflate(base64_decode(“rVVtb5RAEP6sif9hJEbORMCX6AfL0bTaqlGTpr7UxJgG2LljU9jF3eEQf73D2/XacDZ6foFln5nnmZldZvaj8K7nQYJLqWChNaEBz4vu3L5zOxRyBVLMnX7bmdrMcUEtcCvMnkSnmKKivIEzI4lQhQFvMnYrrPIo3C+zEpZI57FJM7lCO3NLbSlp2qf7EB4/erAH+1EYsPFA+EErypjvYPCYIKzL86uc1JQ4L3pHd5MxDDj0qRwKKUSO6ywOc700Os9HsXCIZx1/LtWFnXmPH4Ib5jJy23cwLMCDXrT1uEHXyGV2WbxjqQS8pUEVADjLhTZF52CxTbD9dKBAyjTvcSgOxClJreZOHx2mmYZ75x+PTr8cnX5zT96c8Pr9sfu9jcjpKydVWRF0VXIIfzKHigteW6dXcsDKX/z95JkDqzivcFQHyqRlkND3fSfgsrbxdKRDCgeikGqybHxKhm+Y5axn6/JwydYo11wqXdFsODHGRpMYMoOLuZMRlS+CoK5rv9ZGlAat9bVZBk50Nn6HQXzpPHJzweKrqtcoOU0pYtLGr592jGmG6cV+ZeSczdC0d//rm08f3l+hH+7pkPvZCXzKsLi8o2P+W1JIjIzVMjZCofFTXQTUeQftga5iQm+do9chfkaFEx0M6JVA/lIh4fsr5FJPKxwO6C4K2GAaK9FMKxw1CC9beBcJgaQrMy3wqsN2YV8Y/FGhSrdkcDzCu2iYWDCQbjno0wHdRWGFhrae85ce/B/89kcVGxR/1IGPvdEuerVWgicOX51pqbM1vk3F3VBhR9IK7dPnjzqRxOjaYnAhxS8v0aXHCxu4QJJynLudqRu9YxQOdQm8sNPdYGz319q+pYZ5nDTnXvoi0ZTtOdHa9CaDjdGRchEl2X5slNH9VJfNHrzkZzdOYF3QjYnQDi2LRFIteUBmusB+RnHn7K2Srv0u9MxtZ8E4NeMI7idVnu/Bia65CwpIGrixHV/rxiPFZ8vqk97/8IvDxj8O3TZwXbgvbg3xughTHLZb8Lrfa5n8MCj7Yl+WvSuP0Of9nJ25PE764T1O+dY60aLpTpxjy6Pf”)));

This was obviously an attempt to protect the author’s copyright on the theme.  However; as I heavily modified the original results, I felt the need to protect my own and so I found a solution to decode the footer.

If you run into this same problem, just place the eval code you found into a file called coded.txt.  Then all you need to do is run this decrypt.php PHP script from the same directory and decoded.txt will be created in the same directory and will contain the decoded code.

NOTE: This solution is not mine, it was found on the web at Taree Internet

Syncing with FolderShare (part 2)

It’s taken me over a month to write this.

It should be awesome then!

Nah sorry, just more of the same old crap.

In Syncing with Foldershare part 1 I outlined what I was using FolderShare for. I’ll now outline my reactions after using the service for a while.

FolderShare advertises three main features. Sync My Folders, Share With Friends, Access My Files.

FolderShare Features

Share With Friends – This feature is completely unnecessary. There are literally thousands of ways out there to share a file with your friends. Having a directory synchronized with your friends seems like overkill. As far as the collaborative nature of the feature, collaboration itself belongs on the web. As such there are many online tools such as Google Documents or gliffy provide much better mechanisms for collaborating with others.

Access My Files – This feature scares the crap out of me and if if there is one reason I stop using FolderShare this will be it. It allows you to access every file on any of your computers that is currently connected to FolderShare. This means if someone gains access to your FolderShare account they can access everything from the web.

Surely you mean only the files or directories you’ve told FolderShare to share?

Nope sorry, Everything. A big downside to FolderShare in my mind is the fact everything is configured from their website. You can add a new computer to ‘sync’ with and add sync points right from the website if you have access to the account.

Sync My Folders – This is the only feature I find useful and frankly the only feature I want FolderShare to provide. This allows you to pick (different) folders on two (or more) different computers and sync their contents over the web. They synchronization is recursive so if you have seperate partitions for data feel free to sync the entire partition.

Lessons Learned

FireFox profiles -Firefox keeps some files in your profile locked whenever it’s running. If you have the (synchronized) profile open on more than one computer you will start to get notices that FolderShare cannot copy a certain file. Your only options are ‘retry’ or ‘exit.’ If you choose retry it will obviously fail unless you close FireFox. Choosing to close firefox means you will need to wait several minutes before resuming your work. If you choose exit FolderShare itself exits and you lose your synchronization completely. This didn’t bother me to much I just got in the habit of making sure I closed FireFox on my laptop before attempting to use it on my PC.

After a few weeks however; my PC and Laptop started to get out of sync and at some point Firefox (or Windows I’m not sure which) decided it would be a good idea to reinitialize my entire profile and I lost everything on my laptop. At this time I determined the headaches FolderShare was giving me synchronizing Firefox profiles wasn’t going to work for me. I need a new solution so if someone has one please share. Note that I’m looking for a way to synchronize everything including plug-ins not just settings and history (what Google can currently offer)

iTunes Music Library – As I don’t use iTunes all that often on my home PC this feature is working excellently. However; it suffers the same problems as the Firefox profile synchronization in that the two PCs cannot both run iTunes at the same time.

Security – FolderShare uses your normal Microsoft login. This means that if your MSN account is compromised it instantly exposes all of your personal files on your home computer. This is very scary to me. To make me a bit more at ease FolderShare needs to add some local security features.

  • Only Files and Folders shared Locally (from the PC itself) should be exposed to FolderShare
  • To add a PC should require some sort of authentication from one of the PCs already part of the synchronization

Usefulness – FolderShare seems to be incredibly useful to synchronize data. That being said it seems fundamentally flawed for synchronizing application data that needs to be used very often. The fact that FolderShare synchronizes over the internet as opposed to network connectivity is awesome. This means that even if I’m on the go, when I make a change to a file I’m synchronizing it gets backed up at home.

Syncing with FolderShare (part 1)

FolderShare syncIf you use more than one PC on a regular basis you know how much of a nightmare it is to manually keep everything in sync. Using primarily web tools helps greatly in that respect but it doesn’t solve everything. Whatever the solution you chose you want it to be automatic and simple. I’ve been using FolderShare to keep my laptop and home PC in sync for about a month now and I finally feel I can share the ins and outs I’ve discovered along the way.

This will be a two part post and first I’d like to describe what I’m currently syncing and why, as well as what my future plans for FolderShare are.

My FolderShare LibrariesWhat I’m currently syncing:

  1. All my music regardless of format. I’d love to be able to stream my music using a service like Anywhere.FM (previously posted here) or mediamaster (shared by Barak) but I like to be able to purchase songs and add them to my library wherever I am. I’m using FolderShare to overcome a shortcoming of iTunes itself. If iTunes hosted my music on the web and allow me to purchase songs so that I could download them later, I’d be all set.
  2. My iTunes library. This is due to another shortcoming of iTunes itself. It doesn’t auto detect media. Therefor unless I want to run a tool to auto detect the newly synced media or import files each time I purchased new songs on the other computer I need to keep the actual library synced. A problem with this is iTunes uses absolute paths in their library so I needed to have the directory path of the synchronized music exactly the same (in my case E:music) which meant setting up a partition on my laptop.
  3. My Firefox profile. I use a lot of extensions for Firefox and tend to change them in and out pretty often. It gets to be a pain because I’ll find a setup I really like but I need to install all the extensions and configure them on every PC. Including my work PC this really sucks. Syncing my Firefox profile alleviates all of these problems. You also get the added bonus of synchronized bookmarks and history although that doesn’t really matter to me as I don’t use them.

My future plans are:

  1. Syncing my Windows User Profile. One of the great things about Vista is they finally got the separation of application and data correct despite some applications tendency to corrupt the user space. All the data including your desktop is now under your user profile. I use my desktop as my workspace by keeping files on it that I’m currently working with. This can be anything from videos, documents, software I’m working on or Images. Syncing my user profile will mean regardless of which PC I’m sitting at I’ll have access to the same workspace.
  2. Syncing my Windows Sidebar. I’m not sure how this is going to work, or if its even possible but we’re going to find out. I change the applications on the sidebar out quite frequently, trying different setups. For the same reason I’m syncing my Firefox Profile I’d love to keep the same setup for my sidebar widgets on both PCs.

That’s it for my current uses and future plans. Stay tuned for my next post regarding my lessons learned about FolderShare.

It's the Variable Noob!

I’ve seen a lot of crazy code in the past few years but this one takes the cake. The project I was working several years ago was developed while the developers at my company switched to Java. I’m not sure if that excuses the following or not but it’s at least an attempt.

return (test == true) ? ((test != false) ? true : false) : ((test == false) ? false : true);

Just for the record this whole line equates to:

return test;

Hopefully the compiler is good enough to figure that out but even so it’s a lot of ridiculous confusing code to accomplish something pretty basic and fundamental to any language. The sad part is this line of code wasn’t just found in one place, I found it literally everywhere a boolean value was returned.

I wonder what I’ll find in a few years when I look back at code I wrote?

Social Network Update Overload

Social Network GraphDifferent Audiences see you in different places. I use lots of different services and for different reasons. For the purpose of this post I’ll use only Twitter Facebook and my blog. The number of people that see my ‘tweets’ on Twitter is significantly less than the number of people who see my blog posts. The number of people who see my blog posts directly is significantly less than those who see my Facebook updates. For this reason I have created synchronization points.

Facebook automatically imports my blog posts whenever there’s a new one. At the same time I use TwitterSync to synchronize my twitter updates with my Facebook status. The number of people my posts reach is far greater on Facebook than it is on my blog alone. Many of my friends on Facebook are not tech savvy and therefor are not into feed reading yet. In fact many of them rely on sites like Facebook to get them updates.

You probably think (like the Technology Evangelist) that this means that the people that subscribe to all these services are suffering from Randy Aldrich information overload. If you’re subscribed to each of the 3 different services without any modifications you’re probably right.

I suffered from the same problem. Some of my friends have many services and end up duplicating their content in more than one just like I do. Unfortunately sites like Facebook do not allow you to ‘ignore imported posts’ from certain users. Until that ability exists in the services which you use I suggest making use of Yahoo Pipes.

What I did was create a Pipe that imports my Facebook notes as well as several friend’s blogs. I then use the unique operator to weed out the duplicated posts and that’s it. It is really that simple. Simply combine all the feeds you need to filter through, and utilize the unique operator to filter out the duplicates.

Vista Drivers Be Damned

I finally upgraded my home PC to Vista Ultimate. I was originally worried about compatibility issues and performance. It’s an older PC, approximately 5-6 years old, built by me. It’s a testament to home built PC’s everywhere that it’s still running at all.

From the point of its conception my Home PC has only been upgraded three times. The first was by necessity when the motherboard failed after a year of building it. The second was when I went from the ATI Radeon 9000 to the ATI Radeon 9600xt graphics card. The third upgrade was the combination of my Server and Home PC. In that case the only upgrade was moving the dual 250Gb SATA Raid 1 array and the Antec NeoPower 480 PSU from the server. I guess that makes it more of a migration than an upgrade.

My PC has now been running vista good and strong for over a week. I haven’t yet run the vista experience test yet, I’m worried it’ll flunk with flying colors.

I’ve only had two small problems thus far.

The first is my sound card a SoundBlaster Live! is no longer supported. Apparently there won’t ever be drivers released either, although I find that hard to believe because its a fairly common sound card. For me this wasn’t a huge issue as i’ve been using my onboard sound for years now. The only reason I still have the card in my machine is for voice communication (ie: TeamSpeak or Ventrillo) and I haven’t used that in over a year. I guess it’s time to take it out?

The second issue I ran into was my RAID controller was unsupported. My motherboard is a Soyo Dragon KT600 Plus v2.0. The RAID controller wasn’t detected by the Windows Update Advisor as an issue and so I knew nothing about it beforehand. The first place I checked was naturally Soyo’s site which had plenty of drivers just none for vista.

Hard Drives

Luckily the Raid Controller is still at least semi popular and after doing some searching (and asking a friend who has used vista for a few months now) I happened across drivers for the via vt8237 Raid Controller. And now my computer is all set and running pretty. Can’t believe it but the thing is running smoother than it did on XP Pro for the past 5 years. I even have Aero enabled and the machine only has 1Gb of RAM. We’ll see how long this lasts.

Iterative Development

Items Shared By I don’t think it’s much of a secret that I’m a fan of Google’s web applications. I make use of Google Notebook, Google Reader, Gmail and Google Docs daily. Every time I see they added some new features it makes me very happy. It also reminds me of just how useful Iterative Development practices are, especially in the Web world. It’s great to get a solid product out there and then update it routinely with enhancements.

Along with all the talk about Gmail 2.0 up and coming, along with their new push for Open Social, Orkut and now Android I’ve found a few other updates.

  • Items Shared By… Google Reader’s shared items now displays who shared the item within the first few lines of the item itself. This is great if you (like me) subscribe to many friend’s shared item feeds and group them all together.
  • Tagging Notebook Entries… You can now tag entries in your Google Notebook. This is great for categorizing and quick lookups. I think I’ll be permanently switching over to Google Notebook over my own wiki now just because of this one feature.

Web applications are the future. There is no comparison. The immediate feedback you get from releasing an update over the web is simply an undeniable advantage over client-side installed applications. Applications like Microsoft Office will become a thing of the past. Bandwidth will cease to become an issue and we’ll have all the same features but with immediate updates at our fingertips. As mentioned on JoelonSoftware a few weeks ago, spending money and time engineering todays software to utilize today’s hardware is a waste. Instead just realize that the hardware will handle it and performance will cease to be a problem

I'm NOT Partial

What is with all these partial article feeds? I know the discussion has been beat to death and nobody really has a definitive answer of whats better. Honestly though, isn’t that definitive in itself? The fact that it doesn’t really matter either way and people (LIKE ME) get irritated at having to leave their reader of choice (see Google Reader) would make any sane person just use full article feeds. Don’t you want to make your readers happy after all?

I’m sick and tired of having to navigate to the article in order to get the full benefit. I already subscribe, I comment when I deem appropriate, I contribute where I can, Is it really necessary to force me to your site? The thing that bugs me the most about it is the reason you’re doing it is most likely ad driven. Do you get that many more clicks? I doubt it. I bet the same people that are savvy enough to be subscribed to your feed are savvy enough to utilize the Adblock Plus extension.

I would just like to proclaim that

No blog I maintain will EVER have a partial article feed.

I have noticed this more and more as of late and it MUST STOP!

Unique vs Shared keywords

Hide verses Archive

Ed Kohler recently posted an article entitled Archive vs Hide on Gmail and Google Docs. In this article he talks about the different keywords Google uses to describe essentially the same functionality. This is an issue that is not unique to Google. I’ve seen the same problem across teams where I work as well as within my own work. Another similar problem I see all the time is when the same keyword is used by two different products to refer to different things. This is something that runs rampant where I work and so I’d like to provide a few tips to help avoid these problems.

  1. Publicized Usage – Whether kept internal to the company or not, nothing can help reduce multiple keywords and multiple keyword definitions than letting other teams know what keywords you’ve used and for what.
  2. Regular Collaboration – Preventing the problem is better than dealing with the aftermath, but the only way to find out if the problem exists and to come up with strategies for resolving the problem is collaborating with the other teams.
  3. Publicized Standards – if standards exist the chance for collision of keywords is greatly reduced.
  4. Namespaces – Prefixing a word keyword used on a particular project especially in the case of ID’s helps people identify exactly what that keyword is when seen outside of the project.

If you have any other thoughts or suggestions please let me know!