On 04.05.2012 09:53, Edzard Egberts wrote:
> I'm not sure, whether this problem comes from fltk, but maybe someone
> knows it:
>
> I'm using a write_png() function and it works under Linux. But after
> compiling it for MS-Windows, the software also writes png-files, but
> it's not possible to open them - "PNG file corrupted...".
>
> The only difference regards the libraries for "#include <zlib.h>" and
> "#include <png.h>". For Linux it uses the libraries from system and
> includes "libpng.a" and "libz.a". For MS-Windows it uses the header
> files from "fltk/png" and "fltk/zlib" and it includes "libfltk_png.a"
> and "libfltk_zlib.a".
>
> Where could the problem come from? Maybe related to utf8? How to go on?

How did you open the file? On Windows you must open a file explicitly
as text or binary - one of them is the default, but who knows ? ;-)
I'd guess the default is text, and you need the binary open for PNG
files, like

outfile = fopen (filename, "wb");

Otherwise all LF characters (binary 10) would be converted to CR/LF
on write.

Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to