Skip Menu | will be shut down on March 1st, 2021.

This queue is for tickets about the Imager CPAN distribution.

Maintainer(s)' notes

Tickets for Imager are now on github at

Report information
The Basics
Id: 48261
Status: resolved
Priority: 40/
Queue: Imager

Owner: TONYC [...]
Requestors: TONYC [...]

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

Subject: read/open method should work as class methods.
Download (untitled) / with headers
text/plain 741b
Currently to read a single image file you do: my $im = Imager->new; $im->read(file => $foo) or die; a common mistake is to skip the error check: my $im = Imager->new; $im->read(file => $foo); which still leaves a non-null image in $im, even if the low level image object is missing. To reduce useless boilerplate, it should be possible to call read() as a class method which returns nothing on failure: my $im = Imager->read(file => $foo) or die; In this case, even if the error checking is ommitted, the error is obvious the next time a method is called on $im: my $im = Imager->read(file => $foo); $im->write(file => $bar); # immediate BOOM, since $im is undef Note that read_multi() is already a class method.
Imager->new() can now take file, fh etc parameters to read from that file.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to