Re: pnm loader fixes and tests



----- Original Message -----
From: "Soeren Sandmann" <sandmann daimi au dk>
To: <matthiasc poet de>
Cc: <gtk-devel-list gnome org>
Sent: Wednesday, August 29, 2001 6:24 PM
Subject: Re: pnm loader fixes and tests


> Matthias Clasen <matthiasc poet de> writes:
>
> > Is it ok to commit the following fixes for the pnm loader
> > together with the tests contained in
> >
> > http://bugzilla.gnome.org/showattachment.cgi?attach_id=953
> >
> > ? This patch addresses the initial whitespace problem and
> > a few other problems with invalid pnms.
>
> I tried applying this patch, but I get FAILED (the loaders returns
> 'Unexpected end of PNM image data') on these:
>
>  TEST (valid_ppm_1, TRUE);
>  TEST (valid_ppm_2, TRUE);
>  TEST (valid_ppm_4, TRUE);
>
> I haven't investigated further, but perhaps it is related to the fixes
> for short files that was recently committed?

No, this happens just because the pnm loader is overly correct when it comes
to accepting trailing bytes after the first image found in the file.
It really should ignore trailing stuff, because

a) valid pnm files may contain multiple files

b) if you're manually editing the images with an editor (as I did for the
test images),
you may accidentally introduce additional linebreaks/whitespace at the end
of the last line.

c) other pnm tools do the same

d) it doesn't hurt.

I have put an updated patch for io-pnm.c at

http://bugzilla.gnome.org/showattachment.cgi?attach_id=5028

Matthias





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