Changeset 17059

Show
Ignore:
Timestamp:
28.08.2008 13:51:09 (11 years ago)
Author:
ak19
Message:

The invalid MIMEtype image/jpg for generated images are now changed to the correct MIMEtype image/jpeg (and it's also in lowercase now, just in case).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/plugins/ImageConverter.pm

    r16981 r17059  
    218218 
    219219    if ($image_type ne " ") { 
    220     $type = $image_type; 
     220    $type = $self->correct_mime_type($image_type); 
    221221    } 
    222222 
     
    251251 
    252252    my $thumbnailsize = $self->{'thumbnailsize'}; 
    253     my $thumbnailtype = $self->{'thumbnailtype'}; 
     253    my $thumbnailtype = $self->correct_mime_type($self->{'thumbnailtype'}); 
    254254     
    255255    # Generate the thumbnail with convert 
     
    289289     
    290290    my $screenviewsize = $self->{'screenviewsize'}; 
    291     my $screenviewtype = $self->{'screenviewtype'}; 
     291    my $screenviewtype = $self->correct_mime_type($self->{'screenviewtype'}); 
    292292     
    293293    # make the screenview image 
     
    433433} 
    434434 
     435# image/jpg is not a valid mime-type, it ought to be image/jpeg.  
     436# Sometimes JPEG is passed in also, want to keep things lowercase just in case. 
     437sub correct_mime_type { 
     438    my $self = shift(@_); 
     439    my ($file_extension) = @_; 
     440     
     441    $file_extension = lc($file_extension); 
     442    $file_extension =~ s/jpg/jpeg/s;  
     443 
     444    return $file_extension; 
     445} 
     446 
    4354471;