[ic] image.tag in Perl context

Kevin Walsh kevin at cursor.biz
Tue Jul 24 08:00:39 EDT 2007


Ton Verhagen <tverhagen at alamerce.nl> wrote:
> Dear All,
> 
> Seems that the image tag behaves differently when used
> in Perl context: image dimensions are discarded...
> 
> 
> Please observe the following:
> [image src='os28004.gif' imagesubdir='items']
> 
> Result:
> <img src="/standard/images/items/os28004.gif" width="120" height="150">
> 
>  >> Image dimensions included !
> 
> 
> [perl]
>          return $Tag->image( 'os28004.gif', {imagesubdir => 'items', } );
> [/perl]
> 
> Result:
> <img src="/standard/images/items/os28004.gif">
> 
>  >> NO image dimensions !
> 
> 
> Some additional logging (after the 'eval') in the image tag shows:
> 'require' trapped by operation mask at 
> /usr/local/lib/perl5/site_perl/5.8.2/Image/Size.pm line 20.
> 
The [image] tag calls Image::Size::imgsize() to get the width and height.
and does a runtime require to try to pull in the Image::Size module.
You cannot do this from within a Safe compartment.

Solutions:

    1. Call the tag as a tag, rather than from local Perl code.
       (You can call it as a Perl subroutine from global Perl code).

    2. SafeUntrap require.
       (Not such a good idea).

Correcting myself slightly here:  It appears, from the logged error
message, that Image::Size was already available on your system, and
that the offending 'require' came from the Image::Size module itself.
Same problem - same solutions.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/


More information about the interchange-users mailing list