Hello,

This patch lets xv load uncompressed BMP files with negative height
value in the header.

$ file rightsideup.bmp
rightsideup.bmp: PC bitmap data, Windows 3.x format, 320 x -239 x 32

Google pointed me to wikipedia[0] on this subject. Evidently, if the
height value is negative for uncompressed BMP files, it is an
indication that the bitmap data is stored top to bottom[1].

Pre-patch, xv refuses to open these images saying that dimensions are
too large. This patch addresses this issue (the patch is
post-jumbo-patch applied).

I have already forwarded this patch to Greg Roelofs who maintains the
xv-Jumbo patch.

I tested xv after my patch to make sure it didn't break anything using
the "Test BMP images"[2] referenced from the wikipedia page[0]. All
work except the bottom three which xv didn't like prior to the patch.

Unfortunately, the "rightsideup.bmp" image, and friends, I ran into
are copyrighted content which I do not have permission to
redistribute. Also, ATM I don't know what tool was used to generate
them.

Comments? OK?

Tested on macppc late November snapshot.

Cheers,
--patrick


[0] http://en.wikipedia.org/wiki/BMP_file_format
[1] From [0]: "Uncompressed Windows bitmaps can also be stored from
the top row to the bottom, if the image height value is negative."
[2] http://wvnvaxa.wvnet.edu/vmswww/bmp.html

Attachment: ports.xv.patch.diff
Description: Binary data

Reply via email to