Your message dated Sun, 19 Nov 2017 18:45:33 +0100
with message-id 
<cae6_+ufgft6b1qyd3vgmsbb4z9ogf8h6xvrn4ehkkhp_xok...@mail.gmail.com>
and subject line Re: python-cairo: ImageSurface.write_to_png() transparency 
fails
has caused the Debian Bug report #661005,
regarding python-cairo: ImageSurface.write_to_png() transparency fails
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
661005: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=661005
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: python-cairo
Version: 1.8.8-1+b2
Severity: normal

Dear Maintainer,

It seems writing a png when a surface is fully opaque causes the alpha
channel to be supressed in subsequent writes.


#!/usr/bin/python
import cairo

surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 100, 100)
ctx = cairo.Context(surface)
ctx.set_operator(cairo.OPERATOR_SOURCE)
ctx.set_source_rgba(1,1,1,1) # fully opaque
ctx.paint()
surface.write_to_png("i1.png") # i1.png is an opaque white square.
ctx.set_source_rgba(1,1,1,0)
ctx.paint()
surface.write_to_png("i2.png") # i2.png is an opaque black square (fail).

surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 100, 100)
ctx = cairo.Context(surface)
ctx.set_operator(cairo.OPERATOR_SOURCE)
ctx.set_source_rgba(1,1,1,1)
ctx.paint()
# no write_to_png at this point
ctx.set_source_rgba(1,1,1,0)
ctx.paint()
surface.write_to_png("i3.png") # i3.png is a transparent square

surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 100, 100)
ctx = cairo.Context(surface)
ctx.set_operator(cairo.OPERATOR_SOURCE)
ctx.set_source_rgba(1,1,1,0.9) # some transparency
ctx.paint()
surface.write_to_png("i4.png") # i4.png is a nearly opaque white square.
ctx.set_source_rgba(1,1,1,0)
ctx.paint()
surface.write_to_png("i5.png") # i5.png is a transparent square


Cheers
John


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-cairo depends on:
ii  libc6           2.13-26
ii  libcairo2       1.10.2-6.2
ii  python          2.7.2-9
ii  python-support  1.0.14

python-cairo recommends no packages.

python-cairo suggests no packages.

-- no debconf information



--- End Message ---
--- Begin Message ---
I can reproduce the issue (i2.png being black) on wheezy but no longer
in current sid (i2.png is transparent). I assume this was fixed in
cairo in the meantime.

--- End Message ---
_______________________________________________
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to