]> git.imager.perl.org - imager.git/commitdiff
check for the remnant from thread creation in _valid_image
authorTony Cook <tony@develop-help.com>
Mon, 12 Nov 2012 10:09:09 +0000 (21:09 +1100)
committerTony Cook <tony@develop-help.com>
Fri, 14 Dec 2012 09:27:40 +0000 (20:27 +1100)
CLONE_SKIP simply unblesses the thingy on thread creation, so for the
image to be valid the IMG entry needs to be blessed (as well as true)

Imager.pm

index ab0ae83383d3ea947c6458baf45e68218190723a..85f04ed2529337f66b8d7f9a096ab98793bb87dd 100644 (file)
--- a/Imager.pm
+++ b/Imager.pm
@@ -619,9 +619,9 @@ sub _combine {
 sub _valid_image {
   my ($self, $method) = @_;
 
-  $self->{IMG} and return 1;
+  $self->{IMG} && Scalar::Util::blessed($self->{IMG}) and return 1;
 
-  my $msg = 'empty input image';
+  my $msg = $self->{IMG} ? "images do not cross threads" : "empty input image";
   $msg = "$method: $msg" if $method;
   $self->_set_error($msg);