Changeset 18466 for gsdl/trunk/perllib/plugins/ImageConverter.pm
- Timestamp:
- 2009-02-05T16:32:27+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/ImageConverter.pm
r18404 r18466 156 156 sub generate_images { 157 157 my $self = shift(@_); 158 159 158 my ($filename_full_path, $filename_no_path, $doc_obj, $section) = @_; 160 159 161 160 # check image magick status 162 161 return 0 if $self->{'image_conversion_available'} == 0; 162 163 163 # check the filenames 164 164 return 0 if ($filename_no_path eq "" || !-f $filename_full_path); … … 241 241 } 242 242 if ($self->{'create_screenview'} eq "true") { 243 $self->create_screenview($filename_full_path, $filehead, $doc_obj, $section, $assocfilemeta, $url_to_filehead );243 $self->create_screenview($filename_full_path, $filehead, $doc_obj, $section, $assocfilemeta, $url_to_filehead, $image_width, $image_height); 244 244 } 245 245 } … … 252 252 my $thumbnailsize = $self->{'thumbnailsize'}; 253 253 my $thumbnailtype = $self->correct_mime_type($self->{'thumbnailtype'}); 254 254 255 255 # Generate the thumbnail with convert 256 256 my ($result,$thumbnailfile) … … 282 282 283 283 my $self = shift(@_); 284 my ($original_file, $filehead, $doc_obj, $section, $assocfilemeta, $url_to_filehead ) = @_;284 my ($original_file, $filehead, $doc_obj, $section, $assocfilemeta, $url_to_filehead, $image_width, $image_height) = @_; 285 285 $url_to_filehead = $filehead unless defined $url_to_filehead; 286 286 287 # To do: if the actual image smaller than the screenview size,288 # we should use the original !289 290 287 my $screenviewsize = $self->{'screenviewsize'}; 291 288 my $screenviewtype = $self->correct_mime_type($self->{'screenviewtype'}); 289 290 # Scale the image, unless the original image is smaller than the screenview size and -noscaleup is set 291 my $scale_option = "-geometry $screenviewsize" . "x$screenviewsize"; 292 if ($self->{'noscaleup'} && $image_width < $screenviewsize && $image_height < $screenviewsize) 293 { 294 $scale_option = ""; 295 } 292 296 293 297 # make the screenview image 294 298 my ($result,$screenviewfilename) 295 = $self->convert($original_file, $screenviewtype, "-geometry $screenviewsize" . "x$screenviewsize", "SCREEN");299 = $self->convert($original_file, $screenviewtype, $scale_option, "SCREEN"); 296 300 297 301 #add the screenview as an associated file ... … … 352 356 # but this is no longer needed, as output filename is now 353 357 # explicitly passed back 354 355 358 } 356 359
Note:
See TracChangeset
for help on using the changeset viewer.