Subject: | write_multi() calls _valid_image() on non-invocant parameters |
Date: | Fri, 16 Sep 2016 09:56:37 +1000 |
To: | bug-Imager [...] rt.cpan.org |
From: | tonyc [...] cpan.org |
In general Imager uses the _valid_image() method to check whether the
image a method was called on has an actual image stored, as opposed to
being an "empty" image.
This is safe(ish)* for objects supplied as "$this", since it will
always be an object, but write_multi() calls _valid_image() on
non-invocant parameters, if these aren't objects of any sort, or
aren't Imager objects then the program will crash with a
Can't locate object method "_valid_image" via package "bad class name here"
error.
The following changes are needed:
- _valid_image() should handle being called as a class method (and
fail with a new error)
- write_multi() should check the images provided are blessed objects
and isa("Imager") before calling _valid_image()
* it may have been incorrectly called as a class method