[squeak-dev] Re: Bug reading gray PNG

Javier Díaz Reinoso javier_diaz_r at mac.com
Fri Jan 7 15:40:50 UTC 2011


Sorry , I am attaching the image (gray, 8 bits with palette, non interlaced):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 00666.png.zip
Type: application/zip
Size: 16746 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20110107/1479dff6/00666.png.zip
-------------- next part --------------

On 07/01/2011, at 03:27, Andreas Raab wrote:

> On 1/6/2011 11:20 PM, Javier D?az Reinoso wrote:
>> On 06/01/2011, at 17:02, Andreas Raab wrote:
>> 
>>> On 1/6/2011 10:53 PM, Javier D?az Reinoso wrote:
>>>> Fail with a 217x125 gray PNG in PNGReadWriter>>copyPixelsGray:, reverting to the previous version works.
>>> 
>>> Can you share the file you're using? Even better, write a test that illustrates the failure?
>>> 
>>> Thanks,
>>>  - Andreas
>>> 
>> Is not the image, is bad aritmethic, try with thisScanline ->  217:
> 
> But do you have an example PNG file that causes the problem to happen? I'm sure the issue it's obvious to you but it's not for me.
> 
> Cheers,
>  - Andreas
> 
>>> 0 to: thisScanline size - 1 // 4 do: [ :i |
>>> 		| ii word |
>>> 		ii := i * 4.
>>> 		"This somewhat weird mixture of (#* and #+) with (#bitShift: and #bitOr:)
>>> 		is to make use of faster arithmetic bytecodes, but not of slow largeintegers."
>>> 		word :=
>>> 			(((thisScanline at: ii + 1) * 256 +
>>> 			(thisScanline at: ii + 2) * 256 +
>>> 			(thisScanline at: ii + 3)) bitShift: 8) bitOr:
>>> 			(thisScanline at: ii + 4).<======
>> 
>> 
> 
> 



More information about the Squeak-dev mailing list