GNOME Bugzilla – Bug 162306
[pngdec] does not decode all png files properly.
Last modified: 2005-01-08 16:48:35 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.
Created attachment 35217 [details] Compressed version of the original file which was the input to the pipeline
Created attachment 35218 [details] output from the pipeline described in the bug.
filesrc reads only part of the file per buffer, pngdec expects the whole buffer. For now, use multifilesrc.
*** Bug 163181 has been marked as a duplicate of this bug. ***
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).
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 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.