Skip Menu |

This queue is for tickets about the Imager CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: TONYC [...] cpan.org
Cc:
AdminCc:

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



Subject: redefine setpixel()'s return value
Date: Tue, 6 Aug 2013 23:41:17 +1000
To: bug-Imager [...] rt.cpan.org
From: tonyc [...] cpan.org
Currently setpixel() returns an empty list when: - there's a parameter error (missing co-ordinates, bad colour value, etc) - the caller uses the single pixel interface and that pixel is outside the image. but when asked to a single pixel using the multi-pixel interface it returns a list of ( 0 ). To make the behaviour more sensible, so caller errors can be distinguished from outside-the-image, setpixel should: - return an empty list on a parameter error - return the number of pixels drawn for either call mechanism - if the number of pixels draw is 0, return "0 but true". Tony
On Tue Aug 06 09:41:33 2013, TONYC wrote: Show quoted text
> Currently setpixel() returns an empty list when: > > - there's a parameter error (missing co-ordinates, bad colour value, etc) > > - the caller uses the single pixel interface and that pixel is outside > the image. > > but when asked to a single pixel using the multi-pixel interface it > returns a list of ( 0 ). > > To make the behaviour more sensible, so caller errors can be > distinguished from outside-the-image, setpixel should: > > - return an empty list on a parameter error > > - return the number of pixels drawn for either call mechanism > > - if the number of pixels draw is 0, return "0 but true".
Fixed in Imager 0.98.