freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Freetype] Documentation - PNG images are corrupt


From: Peter Montgomery
Subject: [Freetype] Documentation - PNG images are corrupt
Date: Sun, 15 Jul 2001 16:59:56 -0700

I haven't heard any information about what's causing the problem with
the PNG files used in the documentation so I did a little investigating.
I have an image viewer I wrote which uses the PNG library.  When I load
one of the PNGs in the documentation, I get the following error message:

"PNG file corrupted by ASCII conversion"

Here's information from the PNG site on what likely occurred...

--------------------------
The most common type of file corruption: that due to the transfer of a
binary file in text (or ``ASCII'') mode. On most systems, line-endings
in text files are flagged by either a carriage-return character (CR), a
line-feed character (LF), or both. Macintoshes use CRs; Unix systems use
LFs; and all non-Unix PC systems (DOS, Windows 3.x/95/NT, OS/2) use
CR/LF pairs. PNG's magic signature cleverly includes both a CR/LF pair
and a single LF. Thus when transferring in text mode to a DOS box, for
example, the bare LF will acquire a matching CR; when transferring to a
Unix system, the CR/LF pair will turn into a plain LF; and when
transferring to a Macintosh, both the CR/LF and the bare LF will
probably turn into plain CRs. It's then a simple matter of looking at
the first eight or nine bytes in the file to see whether text-corruption
occurred (which is exactly the sort of thing the Unix file(1) command is
designed to do). Keep in mind that messing up the signature isn't that
big a deal; the real problem is that CR and LF characters in the image
data--which don't have anything to do with line endings or text but
instead refer to pixel values or more abstract compressor tokens--will
also be converted, thus destroying the image.)
--------------------------

So, to the FreeType team, it appears that whatever means you are using
to transfer the PNG images to the FTP site is doing so in text rather
than binary mode.  This may also explain why the FreeType JPG is
completely corrupted as well.  Now that the reason (or the likely
reason) has been given,m is it possible for someone on the FreeType team
to correct the problem?

    Thanks,
    PeterM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]