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/ImagePlugin.pm

    r22663 r23335  
    110110    my ($pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_;
    111111
    112 
    113112    my $outhandle = $self->{'outhandle'};
    114113    my ($filename_full_path, $filename_no_path) = &util::get_full_filenames($base_dir, $file);
     
    116115    if ($self->{'image_conversion_available'} == 1)
    117116    {
    118     my $utf8_filename_no_path = $self->filepath_to_utf8($filename_no_path);
    119     my $url_encoded_filename = &util::rename_file($utf8_filename_no_path, $self->{'file_rename_method'});
    120     $self->generate_images($filename_full_path, $url_encoded_filename, $doc_obj, $doc_obj->get_top_section()); # should we check the return value?
     117    my $filename_encoding = $self->deduce_filename_encoding($file,$metadata);
     118
     119#   my $utf8_filename_no_path = $self->filepath_to_utf8($filename_no_path);
     120#   my $url_encoded_filename = &util::rename_file($utf8_filename_no_path, $self->{'file_rename_method'});
     121
     122#   $self->generate_images($filename_full_path, $url_encoded_filename,
     123#                  $doc_obj, $doc_obj->get_top_section()); # should we check the return value?
     124
     125    $filename_no_path = &unicode::raw_filename_to_url_encoded($filename_no_path);
     126
     127    # should we check the return value?
     128    $self->generate_images($filename_full_path, $filename_no_path,
     129                   $doc_obj, $doc_obj->get_top_section(),$filename_encoding);
     130
    121131    }
    122132    else
Note: See TracChangeset for help on using the changeset viewer.