Opened 19 years ago

Last modified 19 years ago

#745 closed defect (worksforme)

data corruption in PNG using latest gdal-1.2.5 (gdal_translate.exe)

Reported by: grevedan@… Owned by: warmerdam
Priority: high Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description

OS - Windows XP, no SP
Gdal v. 1.2.5 built using Microsoft VC++ 6.0 nmake

Successful default compile using "nmake /f makefile.vc"

Test case 1:

source file = NITF CIB 1 meter satellite imagery projected as Lat/Long
destination file = PNG version of the above

Results - Minor corruption of the original image.

Test case 2:

source file = Geotiff 5.5" aerial photography projected as UTM zone 17
destination file = PNG version of the above

Results - Total corruption of the original image.

In both test cases, some of the original data was retained, while many of the
pixel values were obviously changed.  I ran both test cases using a default
nmake build of gdal-1.2.1 and gdal-1.2.5, the latest gdal (new libpng?) produces
the corrupt results, the old version converts the raster fine.

The files I used to run the test cases and the results (both gdal-1.2.1 and
gdal-1.2.5) are provided as a zip at the below http link.  Currently I'm using
gdal-1.2.1 in my GIS application as a result.

http://24.165.242.10/images/2005_01_18.zip

Change History (3)

comment:1 by grevedan@…, 19 years ago

OS - Windows XP, no SP
Gdal v. 1.2.5 built using Microsoft VC++ 6.0 nmake

Successful default compile using "nmake /f makefile.vc"

Test case 1:

source file = NITF CIB 1 meter satellite imagery projected as Lat/Long
destination file = PNG version of the above

Results - Minor corruption of the original image.

Test case 2:

source file = Geotiff 5.5" aerial photography projected as UTM zone 17
destination file = PNG version of the above

Results - Total corruption of the original image.

In both test cases, some of the original data was retained, while many of the
pixel values were obviously changed.  I ran both test cases using a default
nmake build of gdal-1.2.1 and gdal-1.2.5, the latest gdal (new libpng?) produces
the corrupt results, the old version converts the raster fine.

The files I used to run the test cases and the results (both gdal-1.2.1 and
gdal-1.2.5) are provided as a zip at the below http link.  Currently I'm using
gdal-1.2.1 in my GIS application as a result.

http://24.165.242.10/images/2005_01_18.zip

comment:2 by warmerdam, 19 years ago

Dan,

I tried comparing the PNG files in your zip file but on MacOS X 
the 1.2.5 and 1.2.1 versions look exactly the same.  What were you
using to compare them?

I am guessing that the more recent libpng I am using now in GDAL 
writes some sort of PNG form that is not well supported by some 
older PNG libraries.  I don't know enough about PNG or evolution 
in the format to know what the issue is. 

Once I know what app shows the file as corrupt, I might be able to
figure out more about what is going on. 

comment:3 by grevedan@…, 19 years ago

You are absolutely correct Frank, the problem was the viewer.  To be specific,
the default Windows PNG viewer, "Windows Picture and Fax viewer".  From what I
can talk from the windows process list, this viewer is actually built into the
windows explorer.exe process.

I tried opening the 1.2.5 file with Photoshop, Imagine, and OpenEV, it looks OK.
 Something has to be different in the PNG, but I'd be willing to be this is a
Micro$oft bug.

Thanks for looking at this, I'll let you resolve the bug, this one WORKSFORME :)
Note: See TracTickets for help on using tickets.