Author: tech
Description:
Situation: a GIF image is uploaded to a MediaWiki wiki, image name is (for
example) "spaceship.gif". No problem so far. The wiki doesn't use ImageMagick,
btw.
The image is then placed in an articel as a thumbnail, like this:
[[Image:spaceship.gif|thumb|left|300px|Picture of a spaceship]]. What happens
is that the image gets resized to a width of 300 pixel. The resulting thumbnail
image then carries the filename "300px-spaceship.gif".
However, the image "300px-spaceship.gif" is in PNG format, not a GIF! Yet, it
still carries the ".gif" extension, and is served by the web server
with "Content-Type: image/gif". No problem...most of the time. Most browser
manage to figure out that this "GIF" is, in reality, a PNG (I guess by looking
inside), and manage to display it, most of the time.
The problem may become apparent when saving the article as an HTML page to the
local hard disk for offline browsing. Suddenly, it seems that the PNG-which-is-
disguised-as-a-GIF cannot be displayed as successful any more.
Verified with MSIE6 as browser, when the page was saved with MSIE6 (problem
appears).
Verified with MSIE6 as browser, when the page was saved with httrack-3.40-ALPHA-
5 (problem appears).
Firefox 1.0 works, with page saved with MSIE6 and page saved with httrack-3.40-
ALPHA-5.
Okay, now it's easy to blame everything on Microsoft ;-)
However, the current behavior still relies on the generous tolerance of the
viewer software and is not really according to the specs. As far as I can tell.
Possible options to fix it:
- When a GIF gets transformed, rename the extension to ".png". May cause
problems if there are already two images whose names only differ in the
extension.
- When a GIF gets transformed, attach an additional ".png". Will result in
something like "spaceship.gif.png". Looks sorta stupid, but works more reliable
that option 1, I guess.
- When a GIF gets uploaded, immediately transform it into a PNG. Will break
animated GIFs, and may also cause problems with the GIFs which already present.
No good.
- Disallow GIFs alltogether. Will be regarded as a real stupid idea by many.
Same problems as option 3, too.
- Never transform GIFs. Resizing will have to occur on the client side,
traffic may increase. If this option is implemented, it should be possible to
turn it off in LocalSettings.php.
- Transform GIFs to GIFs, not PNGs. Only problem is the incompatability with
the "Burn All GIFs" movement (which is kind of obsolete anyway now, as the "GIF
patent" wasn't extented). Might be of advantage, if a "Burn All PNGs" movement
appears (in case a Submaraine Patent surfaces which is relevant to PNGs (not
really a joke - one reason why JPEG2000 isn't that popular is said to be the
possibility of potetntial Submarine Patents there, too...).
Holy shit! This was meant to be a bug report and not a political rant!
Version: 1.4.x
Severity: minor