A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-December/041433.html below:

[Python-Dev] Fixes for imageop module

[Python-Dev] Fixes for imageop moduleSjoerd Mullender sjoerd at acm.org
Fri Dec 26 18:09:39 EST 2003
Guido van Rossum wrote:
>>I have some fixes for the imageop module to make it work on systems with 
>>a different byte-order than IRIX (e.g. Linux).  Shall I check them in or 
>>is it not worth it for such an old module?  Anything else that needs to 
>>be changed when I check this in?
>>The fixes of course will result in different results on Linux than 
>>before, so that's the main reason for asking.
> 
> 
> I don't see imageop in the list of deprecated modules in PEP 4, and
> apparently *you* are still using it, so as long as you don't mind
> being potentially the sole maintainer and user, I don't mind these
> being in the distribution.
> 
> What do you mean by different results on Linux?  Was this module
> previously doing something bogus there?
> 
> --Guido van Rossum (home page: http://www.python.org/~guido/)

The main difference is:
***************
*** 570,577 ****
   		r = (r<<5) | (r<<3) | (r>>1);
   		g = (g<<5) | (g<<3) | (g>>1);
   		b = (b<<6) | (b<<4) | (b<<2) | b;
! 		nvalue = r | (g<<8) | (b<<16);
! 		*ncp++ = nvalue;
   	}
   	return rv;
   }
--- 560,569 ----
   		r = (r<<5) | (r<<3) | (r>>1);
   		g = (g<<5) | (g<<3) | (g>>1);
   		b = (b<<6) | (b<<4) | (b<<2) | b;
! 		*ncp++ = 0;
! 		*ncp++ = b;
! 		*ncp++ = g;
! 		*ncp++ = r;
   	}
   	return rv;
   }

where the old ncp is an "Py_UInt32 *" and the new ncp is an "unsigned 
char *".  This results in different byte ordering on a little endian 
machine such as Intel.

-- 
Sjoerd Mullender <sjoerd at acm.org>

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4