Ignore:
Timestamp:
2010-11-19T13:29:29+13:00 (13 years ago)
Author:
davidb
Message:

Work done on improving handing of filenames when the actualy filename encoding used is not necesarrily known. Tested for Linux. Work currently includes some debug statements that will be removed once testing for Windows and Mac is done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/ImageConverter.pm

    r22663 r23335  
    152152sub generate_images {
    153153    my $self = shift(@_);
    154     my ($filename_full_path, $filename_no_path, $doc_obj, $section) = @_;
     154    my ($filename_full_path, $filename_no_path, $doc_obj, $section, $filename_encoding) = @_;
    155155
    156156    # check image magick status
     
    196196
    197197    if ($converttotype ne "" && $filename_full_path !~ m/$converttotype$/) {
    198     #    $doc_obj->add_utf8_metadata($section, "Image", $utf8_filename_meta);
     198#   #    $doc_obj->add_utf8_metadata($section, "Image", $utf8_filename_meta);
    199199
    200200    my ($result, $converted_filename_full_path)
     
    214214
    215215    # here we overwrite the original with the potentially converted one
    216     $doc_obj->set_utf8_metadata_element($section, "Source", &unicode::url_decode($filename_no_path)); # displayname of generated image
    217     $doc_obj->set_utf8_metadata_element($section, "SourceFile", $url_to_filename_no_path); # displayname of generated image
     216#    $doc_obj->set_utf8_metadata_element($section, "Source", &unicode::url_decode($filename_no_path)); # displayname of generated image
     217#    $doc_obj->set_utf8_metadata_element($section, "SourceFile", $url_to_filename_no_path); # displayname of generated image
     218
     219#    $self->set_Source_metadata($doc_obj,$url_to_filename_no_path,undef);
     220
     221    $self->set_Source_metadata($doc_obj,&unicode::url_decode($filename_no_path),
     222                   $filename_encoding);
     223
    218224
    219225    # use identify to get info about the (possibly converted) image
Note: See TracChangeset for help on using the changeset viewer.