diff --git a/macros/core/PGbasicmacros.pl b/macros/core/PGbasicmacros.pl index 202596ecb..4d5a175c0 100644 --- a/macros/core/PGbasicmacros.pl +++ b/macros/core/PGbasicmacros.pl @@ -2923,7 +2923,7 @@ sub image { ); next; } - if (ref $image_item eq 'Plots::Plot' || ref $image_item eq 'Plots::StatPlot') { + if (eval { $image_item->isa('Plots::Plot') }) { # Update image attributes as needed. $image_item->{width} = $width if $out_options{width}; $image_item->{height} = $height if $out_options{height}; @@ -2942,7 +2942,9 @@ sub image { $width_ratio = 0.001 * $image_item->{tex_size}; } $image_item = insertGraph($image_item) - if (grep { ref $image_item eq $_ } ('WWPlot', 'Plots::Plot', 'Plots::StatPlot', 'PGlateximage', 'PGtikz')); + if grep { + eval { $image_item->isa($_) } + } ('WWPlot', 'Plots::Plot', 'LaTeXImage'); my $imageURL = alias($image_item) // ''; $imageURL = ($envir{use_site_prefix}) ? $envir{use_site_prefix} . $imageURL : $imageURL; my $id = $main::PG->getUniqueName('img');