Skip Menu |

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 99507
Status: resolved
Priority: 0/
Queue: Imager

People
Owner: Nobody in particular
Requestors: oha [...] opera.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: bad transparent pixels while reading .ico
Date: Wed, 15 Oct 2014 16:07:52 +0200
To: bug-Imager [...] rt.cpan.org
From: Francesco Rivetti <oha [...] opera.com>
I noticed this while opening some .ico files and writing them back as .png some of the pixels are considered transparent while they weren't supposed to be. as a test case, you can use http://issuu.com/favicon.ico
On Wed Oct 15 10:08:31 2014, oha@opera.com wrote: Show quoted text
> I noticed this while opening some .ico files and writing them back as .png > > some of the pixels are considered transparent while they weren't > supposed to be. > > as a test case, you can use http://issuu.com/favicon.ico
By default Imager treats the icon mask as an alpha channel, since some Windows API calls will effectively use it as one. The mask on your sample image is fairly random. Try calling read with ico_masked => 0 to skip that and let me know if it fixes the problem for you. Tony
Subject: Re: [rt.cpan.org #99507] bad transparent pixels while reading .ico
Date: Mon, 20 Oct 2014 15:33:27 +0200
To: bug-Imager [...] rt.cpan.org
From: Francesco Rivetti <oha [...] opera.com>
On 10/20/2014 02:09 PM, TONYC via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=99507 >
>> as a test case, you can use http://issuu.com/favicon.ico
> > By default Imager treats the icon mask as an alpha channel, since some Windows API calls will effectively use it as one. > > The mask on your sample image is fairly random. > > Try calling read with > > ico_masked => 0 > > to skip that and let me know if it fixes the problem for you.
this actually fixed the issue, and I still have the "right" transparency. I just wonder if I can safely use this on any other case (so far, it seems ok) So yes, it is working. Oha
On Mon Oct 20 09:34:13 2014, oha@opera.com wrote: Show quoted text
> On 10/20/2014 02:09 PM, TONYC via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=99507 >
> >> as a test case, you can use http://issuu.com/favicon.ico
> > > > By default Imager treats the icon mask as an alpha channel, since > > some Windows API calls will effectively use it as one. > > > > The mask on your sample image is fairly random. > > > > Try calling read with > > > > ico_masked => 0 > > > > to skip that and let me know if it fixes the problem for you.
> > this actually fixed the issue, and I still have the "right" > transparency. I just wonder if I can safely use this on any other case > (so far, it seems ok) > > So yes, it is working.
It isn't safe, since ico_masked => 0 will skip using the mask as an alpha channel on palletted icons too. I'll add another option to control masking for images that already have an alpha channel. Tony
On Mon Oct 20 17:03:37 2014, TONYC wrote: Show quoted text
> On Mon Oct 20 09:34:13 2014, oha@opera.com wrote:
> > On 10/20/2014 02:09 PM, TONYC via RT wrote:
> > > <URL: https://rt.cpan.org/Ticket/Display.html?id=99507 >
> > >> as a test case, you can use http://issuu.com/favicon.ico
> > > > > > By default Imager treats the icon mask as an alpha channel, since > > > some Windows API calls will effectively use it as one. > > > > > > The mask on your sample image is fairly random. > > > > > > Try calling read with > > > > > > ico_masked => 0 > > > > > > to skip that and let me know if it fixes the problem for you.
> > > > this actually fixed the issue, and I still have the "right" > > transparency. I just wonder if I can safely use this on any other > > case > > (so far, it seems ok) > > > > So yes, it is working.
> > It isn't safe, since ico_masked => 0 will skip using the mask as an > alpha channel on palletted icons too. > > I'll add another option to control masking for images that already > have an alpha channel.
Done in Imager 1.001. The default is to not use the mask when the image already has an alpha channel. Tony