post 72

By anders pearson 14 Aug 2000

lost about a day’s worth of work because of microsoft today.

microsoft’s operating theory seems to be that people are really stupid. (i can’t really blame them for having this theory because i’m sure they formed it after extensive research and surveying of their own user-base.) unfortunately, they write their software under this assumption and leave no room for the slight possibility that someone might actually know what they’re doing.

one of the guys at work and i had this interesting idea that since most image formats have a field for textual comments, we could simply embed the relevant meta-data for the image into this comment field in an xml format. that would allow us to store meta-data in a way that it would never get seperated from the image and would allow us to more freely move and rename images without having to worry about updating databases or keeping seperate files of meta-data with them. so i threw together a few perl scripts that would embed the metadata such as:

<image>
<title>lousewarts in the dimehaunts</title>
<artist>anders</artist>
<medium>crayon on construction paper</medium>
<date>2000-08-10</date>
<description>thee gauls simper at his tyrant power. he is ghoon with this seven week booths and his mickeyed mausers march into mistory<
</image>

and extract and parse it and do all sorts of cool stuff with it. unfortunately, although everything was working fine in netscape, IE would just refuse to render certain images after the metadata had been added. eventually we tracked it down to the <title> tag. then it was obvious to me what the problem was. IE has this habit of completely ignoring the headers that the webserver sends along with a file telling the browser what kind of data it is dealing with (text/html, text/plain, image/gif, image/jpg, etc). it just assumes across the board that whoever set up the server wasn’t smart enough to configure it to send the proper header or even name the file with the proper extension (a fairly reasonable assumption with microsoft’s own server which is designed to be set up by people who don’t know what they’re doing, but not quite fair to real sysadmins who actually have IQ’s in the triple digit range) so it just looks through the file and tries to figure out what it is. unfortunately, it’s algorithm for identifying file types is less than perfect.

i’ve run into this many times before when trying to set up a demo where people can see the source code for a given webpage or xml document. i create a text file called foo.txt that contains “<h1>IE sucks</h1>” and the webserver sends it out with a text/plain header. netscape shows you the file as text, like it should, IE goes ahead and renders the page like an idiot.

so it sees the <title> tag and tries to render the jpg as an html document. unsurprisingly, that doesn’t work very well. argh.

microsoft’s attitude seems to be something like “no one is allowed to write with words that have more than five letters because the retarded kid might get confused.” an understandable policy for microsoft to make when the retarded kid is the one that pays their salaries but not exactly conducive to producing great works of literature.