Changeset 4724
- Timestamp:
- 2003-06-18T15:11:28+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/ImagePlug.pm
r3540 r4724 33 33 34 34 35 35 36 my $arguments = [ { 'name' => "process_exp", 36 37 'desc' => "A perl regular expression to match against filenames. Matching filenames will be processed by this plugin. Each plugin has its own default process_exp. e.g HTMLPlug defaults to '(?i)\.html?\$' i.e. all documents ending in .htm or .html (case-insensitive).", … … 100 101 } 101 102 102 103 103 sub new { 104 104 my ($class) = @_; … … 109 109 my $option_list = $self->{'option_list'}; 110 110 push( @{$option_list}, $options ); 111 111 112 112 if (!parsargv::parse(\@_, 113 113 q^noscaleup^, \$self->{'noscaleup'}, … … 130 130 } 131 131 132 133 132 sub get_default_process_exp { 134 133 my $self = shift (@_); … … 167 166 } 168 167 168 169 169 # Convert the image to a new type (if required). 170 170 my $converttotype = $self->{'converttotype'}; … … 182 182 my $result = ''; 183 183 $result = `$command`; 184 print $outhandle " $result\n" if ($verbosity > 3);184 print $outhandle "RESULT = $result\n" if ($verbosity > 2); 185 185 186 186 $type = $converttotype; 187 187 } 188 188 189 189 190 # Add the image metadata 190 191 my $url = $file; … … 205 206 $doc_obj->add_metadata ($section, "ImageSize", $image_size); 206 207 208 209 $doc_obj->add_metadata ($section, "srclink", 210 "<a href=_httpcollection_/index/assoc/[assocfilepath]/[Image]>"); 211 $doc_obj->add_metadata ($section, "/srclink", "</a>"); 212 213 $doc_obj->add_metadata ($section, "srcicon", "<img src=_httpcollection_/index/assoc/[assocfilepath]/[Image] width=100>"); 214 215 207 216 # Add the image as an associated file 208 217 $doc_obj->associate_file($filename,$file,"image/$type",$section); 218 209 219 210 220 # Make the thumbnail image 211 221 my $thumbnailsize = $self->{'thumbnailsize'} || 100; 212 222 my $thumbnailtype = $self->{'thumbnailtype'} || 'gif'; 223 213 224 my $thumbnailfile = &util::get_tmp_filename() . ".$thumbnailtype"; 214 225 $self->{'tmp_filename2'} = $thumbnailfile; … … 217 228 my $command = "convert -interlace plane -verbose -geometry $thumbnailsize" 218 229 . "x$thumbnailsize \"$filename\" \"$thumbnailfile\""; 219 print $outhandle " $command\n" if ($verbosity > 2);230 print $outhandle "THUMBNAIL: $command\n" if ($verbosity > 2); 220 231 my $result = ''; 221 232 $result = `$command 2>&1` ; 222 print $outhandle " $result\n" if ($verbosity > 3);233 print $outhandle "THUMB RESULT: $result\n" if ($verbosity > 2); 223 234 224 235 # Add the thumbnail as an associated file ... … … 228 239 $doc_obj->add_metadata ($section, "ThumbType", $thumbnailtype); 229 240 $doc_obj->add_metadata ($section, "Thumb", "thumbnail.$thumbnailtype"); 241 242 $doc_obj->add_metadata ($section, "thumbicon", "<img src=_httpcollection_/index/assoc/[assocfilepath]/[Thumb] width=[ThumbWidth] height=[ThumbHeight>"); 230 243 } 231 244 … … 267 280 $doc_obj->add_metadata ($section, "ScreenType", $screenviewtype); 268 281 $doc_obj->add_metadata ($section, "Screen", "screenview.$screenviewtype"); 282 283 $doc_obj->add_metadata ($section, "screenicon", "<img src=_httpcollection_/index/assoc/[assocfilepath]/[Screen] width=[ScreenWidth] height=[ScreenHeight>"); 269 284 } else { 270 285 print $outhandle "ImagePlug: couldn't find \"$screenviewfilename\"\n"; … … 273 288 274 289 return $type; 275 } 290 291 292 } 293 276 294 277 295 … … 412 430 413 431 1; 432 433 434 435 436 437 438 439 440 441 442
Note:
See TracChangeset
for help on using the changeset viewer.