Re: Do PNG files come in 64-bit format ??

Bob Friesenhahn <[email protected]> Fri, 11 Dec 2020 11:50:00 -0600 (CST)
Newsgroups gmane.comp.graphics.png.devel
Message-ID <[email protected]>
On Fri, 11 Dec 2020, John Emmas wrote:

> Many years ago I built a program which needs to load PNG files (it was a 
> 32-bit build using MSVC in case that's relevant and it uses a popular library 
> called gdk-pixbuf...)
>
> I've been converting the program to 64-bit - but strangely, I'm finding it 
> won't load PNG files any more. Whenever I try to load any of my PNG samples, 
> the function 'gdk_pixbuf_get_module()' returns this error:- "Couldn't 
> recognize the image file format for file"
>
> I should probably ask this question in the gdk-pixbuf mailing list - but 
> before doing that I'd just like to check if there are different 'versions' of 
> PNG files (i.e. 32-bit versions and 64-bit versions). Other formats are 
> loading okay (JPEG / TIFF etc) so I just wanted to check. Thanks,

No.  There is only one version of PNG files.  The PNG format was not 
updated for 64-bit apps. :-)

The PNG format is designed to only deal with a small bit of data at a 
time.

The main thing to be aware of under Windows when porting from 32 to 
64-bits is that the size of a 'long' type remains the same, but the 
size of 'size_t' (the size of memory that malloc may allocate) and the 
size of pointers become 64 bits.  This means that additional work 
must be done under Windows in order for a ported 32-bit app to fully 
benefit from 64-bits, and care must be taken to avoid passing 64-bit 
values into 32-bit storage.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt