[cairo] BUG: CAIRO_FORMAT_ARGB32, image_surface transparency = CAIRO_IMAGE_IS_OPAQUE after write_png()

Adrian Johnson ajohnson at redneon.com
Tue Jun 7 11:46:04 UTC 2016


On 07/06/16 15:28, lamer314 at mail.ru wrote:
> Ok, but writing PNG shall not affect consequent writings. If we paint
> later with transparent source it is not opaque anymore and then 
> _cairo_image_analyze_transparency() shall run again.

I missed that part of the bug report. I thought the bug was about
writing ARGB32 images as opaque PNG when all alpha is 255. Failing to
analyze the transparency after updating the image is a bug. The attached
patch should fix it.

> I think it would be good idea to add some function like
> cairo_surface_write_to_png_flat() which will dump image data
> to PNG in the same format as surface. It also can be usefull for
> debugging then user can open file in image viwer and see what data
> in what format hi is actually working on.

The PNG surface is a convenience for testing, debugging, and creating
examples. Providing comprehensive support for image reading and writing
with various options is outside the scope of cairo. There are other
libraries that can perform this task.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-image-only-cache-transparency-and-color-analysis-for.patch
Type: text/x-patch
Size: 1455 bytes
Desc: not available
URL: <https://lists.cairographics.org/archives/cairo/attachments/20160607/293dab8a/attachment-0001.bin>


More information about the cairo mailing list