After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 162306 - [pngdec] does not decode all png files properly.
[pngdec] does not decode all png files properly.
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins
git master
Other Linux
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 163181 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-12-27 09:28 UTC by tommydal
Modified: 2005-01-08 16:48 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Compressed version of the original file which was the input to the pipeline (878.11 KB, application/x-compressed-tar)
2004-12-27 09:31 UTC, tommydal
  Details
output from the pipeline described in the bug. (264.83 KB, image/jpeg)
2004-12-27 09:39 UTC, tommydal
  Details
Patch implementing progressive PNG decoding (13.18 KB, patch)
2005-01-07 14:04 UTC, Gergely Nagy
none Details | Review
Fixed patch implementing progressive PNG reading (12.88 KB, patch)
2005-01-07 16:30 UTC, Gergely Nagy
none Details | Review

Description tommydal 2004-12-27 09:28:14 UTC
Using the following pipeline:

gst-launch filesrc location="/home/tommy/GNOME-Sunset_blue_1280x1024.png" !
pngdec ! pngenc ! filesink location="/home/tommy/Test.png"

Causes the following errors while running the pipeline:

...
** (process:3334): WARNING **: reading past end of buffer
...

Additionally the file outputted at the end of the the pipeline is not the same
as the original file. Using gdkpixbufdec yields the correct results.
Comment 1 tommydal 2004-12-27 09:31:58 UTC
Created attachment 35217 [details]
Compressed version of the original file which was the input to the pipeline
Comment 2 tommydal 2004-12-27 09:39:47 UTC
Created attachment 35218 [details]
output from the pipeline described in the bug.
Comment 3 Ronald Bultje 2004-12-27 11:13:06 UTC
filesrc reads only part of the file per buffer, pngdec expects the whole buffer.
For now, use multifilesrc.
Comment 4 David Schleef 2005-01-06 23:52:55 UTC
*** Bug 163181 has been marked as a duplicate of this bug. ***
Comment 5 Gergely Nagy 2005-01-07 14:04:27 UTC
Created attachment 35609 [details] [review]
Patch implementing progressive PNG decoding

This patch basically redoes ext/libpng/gstpngdec.[ch], so pngdec becomes a
progressive PNG reader. That means that we decode the data as it flows in, thus
removing the buffer == file limitation.

While there, this also adds support for RGBA images, and removes the limitation
that lines must be width*4 bytes wide (this makes decoding 8bit RGB PNGs work
as expected).

As far as I could test, there are no regressions. On the other hand, pngdec
works much better.

Will add paletted and grayscale support later (as soon as I figure out how).
Comment 6 Gergely Nagy 2005-01-07 16:30:57 UTC
Created attachment 35620 [details] [review]
Fixed patch implementing progressive PNG reading

Changes compared to my original patch:

in pngdec_info_callback(): Moved memory allocation after the caps stuff. If the
image is not appropriate, that gets handled while setting up the caps. Until we
do not know the memory is needed, don't allocate it - that is the reason.

in gst_pngdec_chain(): Do not destroy ->png_ptr and ->info, leave that to
->finalize (so that we don't try to destroy it twice, and won't be in trouble
if _chain gets called again immediately after an ERROR)

A ChangeLog entry is prepended before the actual diff.
Comment 7 Gergely Nagy 2005-01-08 16:48:35 UTC
Comment on attachment 35620 [details] [review]
Fixed patch implementing progressive PNG reading

Since the buffer == file assumption is intentional, and there is a separate
bugreport (with patch) about the alpha channel issue, my patch is obsolete and
should not be applied.

Sorry for the noise.