<div dir="ltr">I'm having a strange error when Gdal uses libpng<div><br></div><div>Environment : </div><div>x86-64 linux</div><div>gdal 1.10</div><div>libpng 1.6.2</div><div><br></div><div>I am getting the following message :</div>

<div><br></div><div><span style="font-family:arial,sans-serif;font-size:12.800000190734863px">GDAL (CPLE_NotSupported): The PNG driver failed to in png_create_read_struct().</span><br style="font-family:arial,sans-serif;font-size:12.800000190734863px">

<span style="font-family:arial,sans-serif;font-size:12.800000190734863px">This may be due to version compatibility problems.</span></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">which is in this snippet in pngdataset.cpp:</font></div>

<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><div>#if LIBPNG_VER_MINOR >= 2 || LIBPNG_VER_MAJOR > 1</div><div>        int version = png_access_version_number();</div><div>

        CPLError( CE_Failure, CPLE_NotSupported, </div><div>                  "The PNG driver failed to access libpng with version '%s',"</div><div>                  " library is actually version '%d'.\n",</div>

<div>                  PNG_LIBPNG_VER_STRING, version);</div><div>#else</div><div>        CPLError( CE_Failure, CPLE_NotSupported, </div><div>                  "The PNG driver failed to in png_create_read_struct().\n"</div>

<div>                  "This may be due to version compatibility problems." );</div><div>#endif</div><div><br></div><div>If i understand correctly, if i get the second messsage, that is supposed to mean that pngdataset.cpp was compiled with a libpng older than 1.2, or that the macros don't exist (#if takes a value of 0 if a macro name is not found)</div>

<div><br></div><div>I compiled my GDAl with libpng 1.6.2, and ldd properly tells me that it's this version GDAL tries to link to</div><div><br></div><div>I think i don't get the first message because, at least for png 1.5 and 1.6 ( and even the v1.2 shipped with gdal ), LIBPNG_VER_MINOR  and LIBPNG_VER_MAJOR are not in png.h. Instead, there are PNG_LIBPNG_VER_MINOR  and PNG_LIBPNG_VER_MAJOR. So the code should also try to look for those macros</div>

</font><font face="arial, sans-serif"><div><br></div><div>As to why i am reaching this code, i couldn't find if GDAL is compatible with libPNG 1.6, could you confirm it? I successfully build with it on windows and linux; it works on widowns (and might have previously worked on linux, before i recompiled gdal to add the python module)</div>

</font><div><br></div>-- <br><div dir="ltr">Olivier BARTHELEMY</div>
</div></div>