Changeset 16382

Show
Ignore:
Timestamp:
14.07.2008 14:38:47 (11 years ago)
Author:
kjdon
Message:

filename_no_path arg to generate_images must now be in utf8, and then the filename metadata is added using set_utf8_metadata instead of set_metadata

Files:
1 modified

Legend:

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

    r16025 r16382  
    2929 
    3030use strict; 
     31no strict 'refs'; # allow filehandles to be variables and viceversa 
     32 
    3133use gsprintf 'gsprintf'; 
    3234 
     
    142144    &gsprintf($outhandle, "ImageConverter: {ImageConverter.noconversionavailable} ({ImageConverter.".$self->{'no_image_conversion_reason'}."})\n"); 
    143145    } 
     146        
    144147} 
    145148     
     
    149152# generate screenview if required 
    150153# discover image metadata 
     154# filename_no_path must be in utf8 
    151155sub generate_images { 
    152156    my $self = shift(@_); 
     
    191195 
    192196    # add Image metadata  
    193     $doc_obj->add_metadata($section, "Image", $filename_no_path); 
    194  
    195     # Source and SourceUTF8 - should this be converted filename or original? 
    196     # here we overwrite the originals with converted ones 
    197     $self->set_Source_metadata($doc_obj, $filename_no_path); 
     197    $doc_obj->add_utf8_metadata($section, "Image", $filename_no_path); 
     198 
     199    # here we overwrite the original with the potentially converted one 
     200    $doc_obj->set_utf8_metadata_element($section, "Source", $filename_no_path); 
    198201 
    199202    # use identify to get info about the (possibly converted) image 
     
    245248                 "image/$thumbnailtype",$section); 
    246249    $doc_obj->add_metadata ($section, "ThumbType", $thumbnailtype); 
    247     $doc_obj->add_metadata ($section, "Thumb", $filehead."_thumb.$thumbnailtype"); 
     250    $doc_obj->add_utf8_metadata ($section, "Thumb", $filehead."_thumb.$thumbnailtype"); 
    248251     
    249252    $doc_obj->add_metadata ($section, "thumbicon", "<img src=\"_httpprefix_/collect/[collection]/index/assoc/$assocfilemeta/[Thumb]\" width=[ThumbWidth] height=[ThumbHeight]>"); 
     
    282285    $doc_obj->associate_file("$screenviewfilename", $filehead."_screen.$screenviewtype", "image/$screenviewtype",$section); 
    283286    $doc_obj->add_metadata ($section, "ScreenType", $screenviewtype); 
    284     $doc_obj->add_metadata ($section, "Screen", $filehead."_screen.$screenviewtype"); 
     287    $doc_obj->add_utf8_metadata ($section, "Screen", $filehead."_screen.$screenviewtype"); 
    285288     
    286289    $doc_obj->add_metadata ($section, "screenicon", "<img src=\"_httpprefix_/collect/[collection]/index/assoc/$assocfilemeta/[Screen]\" width=[ScreenWidth] height=[ScreenHeight]>");