[Cin] Real fix for 16-bit pngs

Andrew Randrianasulu randrianasulu at gmail.com
Tue Mar 24 13:02:42 CET 2020

Sorry, I apparently send wrong patch - 16 bit pngs were still broken.

I scratched my head a lot (because it was working!)
and realized I swapped order of calls!

diff relative to commit 8c43913b9f18a3856bbff826aef96587a32f0470

diff --git a/cinelerra-5.1/cinelerra/filepng.C b/cinelerra-5.1/cinelerra/filepng.C
index 4df95f1e..c2e1cf6c 100644
--- a/cinelerra-5.1/cinelerra/filepng.C
+++ b/cinelerra-5.1/cinelerra/filepng.C
@@ -229,9 +229,9 @@ int FilePNG::write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit)
                                asset->png_use_alpha ?  PNG_COLOR_TYPE_RGB_ALPHA : PNG_COLOR_TYPE_RGB,
 // does not work (gg 2020/03/17 libpng16 fc31)
+                       png_write_info(png_ptr, info_ptr);
                        if( asset->png_depth == 16 && BC_Resources::little_endian )
-                       png_write_info(png_ptr, info_ptr);
                        png_write_image(png_ptr, output_frame->get_rows());
                        png_write_end(png_ptr, info_ptr);
                        result = 0;

this way it SHOULD work .... Tested!

Also, hint for ccache:
in .ccache/ccache.conf set for maximum compression

compression = true
compression_level = 8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: filepng_16_bit_real_fix.diff
Type: text/x-diff
Size: 777 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20200324/14c2c338/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sixteen_bits_test2.png
Type: image/png
Size: 179184 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20200324/14c2c338/attachment-0001.png>

More information about the Cin mailing list