[Patches] [ python-Patches-874358 ] imageop on little-endian
systems uses reversed byte order
SourceForge.net
noreply at sourceforge.net
Sat Jan 10 15:44:38 EST 2004
Patches item #874358, was opened at 2004-01-10 11:47
Message generated for change (Comment added) made by sjoerd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=874358&group_id=5470
Category: Modules
Group: Python 2.4
>Status: Closed
Resolution: None
Priority: 5
Submitted By: Sjoerd Mullender (sjoerd)
Assigned to: Sjoerd Mullender (sjoerd)
Summary: imageop on little-endian systems uses reversed byte order
Initial Comment:
The format of the string data used in the imageop
module is described as "This is the same format as used
by gl.lrectwrite() and the imgfile module." This
implies a certain byte order in multi-byte pixel formats.
However, the code was originally written on an SGI
(big-endian) and *uses* the fact that bytes are stored
in a particular order in ints. This means that the
code uses and produces different byte order on
little-endian systems.
The attached patch adds a module-level flag
"backward_compatible" (default not set, and if not set,
behaves as if set to 1--i.e. backward compatible) that
can be used on a little-endian system to use the same
byte order as the SGI. Using this flag it is then
possible to prepare SGI-compatible images on a
little-endian system.
This patch is the result of a (small) discussion on
python-dev.
----------------------------------------------------------------------
>Comment By: Sjoerd Mullender (sjoerd)
Date: 2004-01-10 21:44
Message:
Logged In: YES
user_id=43607
Checked in as rev 2.28 (imageop.c) and 1.12 (libimageop.tex).
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2004-01-10 17:50
Message:
Logged In: YES
user_id=6380
Works for me!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=874358&group_id=5470
More information about the Patches
mailing list