Changeset 4086


Ignore:
Timestamp:
Oct 22, 2009, 6:23:52 PM (11 years ago)
Author:
ronosman
Message:

bug 1201 fixed : pLoader crashes when path or filename contains unicode characters. All filename or path on windows must be ANSI converted when using perl file operators.

Location:
extensions/pLoader/trunk/src/Uploader
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/pLoader/trunk/src/Uploader/GUI/wxApp.pm

    r4077 r4086  
    336336    # to check if we can use stored cache
    337337    $self->imagelist_version(
    338         '4'
     338        '5'
    339339    );
    340340
  • extensions/pLoader/trunk/src/Uploader/GUI/wxFrameAUI.pm

    r4085 r4086  
    2222use Carp;
    2323use Wx;
     24use Win32;
    2425use Wx::DND;
    2526use Wx qw/
     
    16051606    my $files = [
    16061607        map {
    1607             encode('iso-8859-1', $_)
     1608            # to make sure that unicode chars in filenames are supported
     1609            {
     1610                ANSIPathName => $^O =~ /MSWin32/ ? Win32::GetANSIPathName($_) : encode('iso-8859-1', $_),
     1611                PathName => $_,
     1612            },
    16081613        }@$file_paths   
    16091614    ];
    16101615
    1611     @$files = sort @$files;   
     1616    @$files = sort { $a->{PathName} cmp $b->{PathName} } @$files;   
    16121617
    16131618    $self->imagelist->SetNewFiles(
  • extensions/pLoader/trunk/src/Uploader/ImageList.pm

    r3731 r4086  
    204204
    205205    map {
    206         my $info = $self->_read_exif_metatdata($_);
     206        my $info = $self->_read_exif_metatdata($_->{ANSIPathName});
    207207        my $is_new_image = $self->_add_image($_, $info, $i);   
    208208        $self->SetCurrentImage($i);
     
    269269    ) if !$self->image_sums;
    270270
    271     my $sum = file_md5_hex($file);
     271    my $sum = file_md5_hex($file->{ANSIPathName});
    272272
    273273    my $image;
    274274    if ( !exists $self->image_sums->{$sum} ){
    275 print "_add_image ", $file, "\n";
     275        print "_add_image ", Dumper $file, "\n";
    276276        # append to image list
    277277        $image = Uploader::Image->new(
    278278        {
    279                 file              => $file,
     279                file              => $file->{ANSIPathName},
    280280                file_sum          => $sum,
    281                 site_name         => $self->_default_photo_name($file, $info, $i),
     281                site_name         => $self->_default_photo_name($file->{PathName}, $info, $i),
    282282                site_author       => $self->author,
    283283                exif_metadata     => $self->_select_exif_data($info),
     
    285285                site_categories   => [],
    286286                site_tags         => [],
    287                 site_high_file    => $_,
     287                site_high_file    => $file->{ANSIPathName},
    288288            }
    289289        );
     
    996996                gettext("upload succcessful"),
    997997            );
    998 
     998           
    999999            push @{$self->uploaded_images}, $_;
    10001000            $uploaded++;
Note: See TracChangeset for help on using the changeset viewer.