Changeset 16923


Ignore:
Timestamp:
2008-08-20T17:48:10+12:00 (16 years ago)
Author:
ak19
Message:
  1. Sets both the Source and new SourceFile metadata; 2. Calls unicode::filename_to_url() to work out the url to files
File:
1 edited

Legend:

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

    r16901 r16923  
    189189    # Encode those percent signs themselves so that urls to the imgs refer to them correctly
    190190    my $url_to_filehead = $filehead;
    191     $url_to_filehead =~ s/%/%25/g if($url_to_filehead !~ m/%25/);
     191    $url_to_filehead = &unicode::filename_to_url();
    192192    my $url_to_filename_no_path = $filename_no_path;
    193     $url_to_filename_no_path =~ s/%/%25/g if($url_to_filename_no_path !~ m/%25/);
     193    $url_to_filename_no_path = &unicode::filename_to_url();
    194194   
    195195    # Convert the image to a new type (if required).
     
    212212
    213213    # here we overwrite the original with the potentially converted one
    214     $doc_obj->set_utf8_metadata_element($section, "Source", $filename_no_path); # name of generated image
     214    $doc_obj->set_utf8_metadata_element($section, "Source", &unicode::url_decode($filename_no_path)); # displayname of generated image
     215    $doc_obj->set_utf8_metadata_element($section, "SourceFile", $filename_no_path); # displayname of generated image
    215216
    216217    # use identify to get info about the (possibly converted) image
Note: See TracChangeset for help on using the changeset viewer.