[Gdal-dev] Re: Fix for PNG byte order problems under x86

Frank Warmerdam warmerdam at pobox.com
Thu Jan 29 15:44:58 EST 2004


Robert Osfield wrote:
> On Thursday 29 January 2004 18:59, Frank Warmerdam wrote:
> 
>>Robert,
>>
>>It seems the png_set_swap() function wasn't working for me.  I have
>>modified the code to explicitly swap the data in the row reading method.
> 
> 
> Could it be that the code doesn't pngdataset doesn't directly include 
> cpl_port.h so CPL_LSB is never defined, so the png_set_swap never gets 
> called?

Robert,

I don't think that's it because I have my code in an #ifdef CPL_LSB
as well.  In fact, the png_set_swap() did *seem* to change the data, but it
just wasn't correct. I don't know what I'm missing but for now I'm not worried
about it.  I just wanted to let you know.

> I must admit I hadn't tested the addition of the #ifdef against the datafiles 
> today.  Originally when I did the testing it was without any guards, it 
> worked fine back then.  Sorry about this, I'm afraid my thoroughness has 
> obviously slipped, like yourself toooo bussyyyy!!!

No problem.  The issue might be a quirk in my copy of libpng ... who knows.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the Gdal-dev mailing list