|Friday, August 29, 2003
11:41 - <bang> <bang> <bang>
Do pardon the forehead marks on the table.
So in the ongoing battle against Microsoft's unbelievable lack of proactiveness in fixing that stupid JPEG/RDF/XML/IPTC header bug (wherein MSIE will go into a death spiral if it encounters a JPEG that contains an XMP packet with profile and path information, such as Adobe Photoshop writes), I've hit another snag.
The long-time Photoshop users said, effectively, "Well, duh, of course there's a difference between Save As and Save For Web". Obvious to you, of course, but based on the people who have been emailing me, saying "Oh, so that's what's wrong with my site!" plenty of folks are actually using the inappropriate save option for web purposes. That's a user behavior problem and I'm not sure what the best solution is for that. Adobe could add warning dialogs until they were blue in the face, but they'd still fall victim to [Frank's First Law of Documentation].
All available information suggests that XMP data is a documented, accepted extension to the jpeg standard. Without any evidence to the contrary, my perception is that Adobe has committed no crime, and the onus is on Microsoft to fix Windows IE's jpeg decoder. Hopefully someone read my bug report. Nobody from MS has contacted me.
In the meantime, what can web developers do to avoid the problem?
Well, first and most obvious, if you are creating static graphics, use Save For Web. And (hopefully you're already doing this) test your site on as many platforms as you can.
For more dynamic sites, such as snapclub.com, which accept jpeg file uploads from arbitrary third-parties, there is at least one solution; ImageMagick's "mogrify" command can be used to remove the metadata from the jpeg like so:
mogrify +profile iptc image.jpg
...Which I've been using for a month or two now. And it's worked great. Or so I'd thought.
See, I was sure I'd checked to make sure that this command didn't recompress the JPEG while it was stripping out the IPTC header. I was sure it left the image quality alone. But several artists have e-mailed me to let me know that no, this is not the case. The mogrify command does in fact recompress the JPEG, at some arbitrary level (probably the default 60). So all the many thousand images that people have been uploading in the past month have all been recompressed to some godawful level. And it's only now that they've got the better of their politeness and notified me of it.
<bang> <bang> <bang>
It hardly bears pointing out that this is Microsoft's problem to fix, and that while this problem is increasingly widespread with the adoption of Photoshop 7 in web design houses, most Windows users don't even notice what happens (namely, that IE abruptly stops being able to open JPEG images, and spins endlessly upon opening pages, until you hard-kill the process or reboot), figure it's "some damn worm or something", and reboot. Certainly nobody's able to trace it back to some "poisoned" image that IE choked on way back during the person's surfing history. And needless to say, there's been a patch made available, but it's so low-key and so little has been made of it (or people are so distrustful of software patches and the Windows Update process) that nobody has apparently installed it.
So I, the web designer, get the blame from those people who do encounter the problem. And Microsoft gets off scot free. Like always.
And I have to write godawful workarounds on the server side to clean up after Microsoft's incompetence. And the tools I have to do that aren't a complete solution, and indeed can be worse than the original problem. So I'm stuck.
I guess I can still mogrify the thumbnails, so at least people won't have their browsers freeze up in the middle of loading a gallery page-- only when they should happen to open one of the offending images. JPEG quality on thumbnails isn't a big issue. And maybe this will be good enough.
God damn I hate those two words.
Thank you again, Microsoft. Hope you're enjoying your Freedom To Innovate™.
By the way... is it just me, or was Microsoft's current slogan written by Yoda? "Hmmm! Do Amazing Things You Can. With Windows XP, Yes!"
UPDATE: Chris Adams has been down this road before, and he has the answer: jpegtran, which is part of libjpeg (a package that ImageMagick has as an installation prerequisite anyway):
jpegtran -copy none -outfile nometa.jpg meta.jpg
And the resulting file has no meta-data and has not been recompressed. Yes!
So all I gotta do is jpegtran all my uploads, then copy the resulting files back over the source files, and all will be well...