Changeset 4121


Ignore:
Timestamp:
Oct 26, 2009, 9:39:44 PM (11 years ago)
Author:
ronosman
Message:

Bug 1213 fixed. Accented characters in file and path names make pLoader Linux crash.

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

Legend:

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

    r4118 r4121  
    152152use Storable;
    153153use Uploader::GUI::wxPropertyGridPanel;
    154 use Encode qw/encode decode is_utf8/;
    155154use utf8;
    156155$|=1;
     
    14361435            # to make sure that unicode chars in filenames are supported
    14371436            {
    1438                 ANSIPathName => $^O =~ /MSWin32/ ? Win32::GetANSIPathName($_) : encode('iso-8859-1', $_),
     1437                ANSIPathName => $^O =~ /MSWin32/ ? Win32::GetANSIPathName($_) : $_,
    14391438                PathName => $_,
    14401439            },
  • extensions/pLoader/trunk/src/Uploader/ImageList.pm

    r4090 r4121  
    2929use Storable;
    3030use Digest::MD5::File qw/file_md5_hex md5_hex/;
    31 use Encode qw/encode decode is_utf8/;
    3231use Wx::Locale qw/:default/;
    3332use Wx;
     
    200199    );
    201200    $self->current_image->preview_file(
    202         encode('iso-8859-1', $self->current_image->preview_file)
     201        $self->current_image->preview_file
    203202    );
    204203
     
    335334    my ( $self, $file, $info, $i ) = @_;
    336335   
    337 #    $file = encode('iso-8859-1', $file);
    338336   
    339337    my $name;
     
    571569            "%s:%s",
    572570            $self->type,
    573             encode('iso-8859-1', $self->current_image->wx_thumb_file),
     571            $self->current_image->wx_thumb_file,
    574572        )
    575573    );
     
    629627            "%s:%s",
    630628            $self->type,
    631             encode('iso-8859-1', $self->current_image->preview_file),
     629            $self->current_image->preview_file,
    632630        )
    633631    );
     
    708706            "%s:%s",
    709707            $self->type,
    710             encode('iso-8859-1', $self->current_image->site_resized_file),
     708            $self->current_image->site_resized_file,
    711709        )
    712710    );
     
    732730
    733731    my $status = $image->ReadImage(
    734         encode('iso-8859-1', $self->current_image->site_resized_file)
     732        $self->current_image->site_resized_file
    735733    );
    736734    warn "$status" if $status ;
     
    760758            "%s:%s",
    761759            $self->type,
    762             encode('iso-8859-1', $self->current_image->site_thumb_file),
     760            $self->current_image->site_thumb_file,
    763761        )
    764762    );
     
    11261124        }       
    11271125        $image->Write(
    1128             filename=>encode('iso-8859-1', $self->current_image->site_high_file)
     1126            $self->current_image->site_high_file
    11291127        );
    11301128        warn "$status ", $self->current_image->site_high_file, "\n" if $status ;
     
    12061204   
    12071205    my $status = $image->ReadImage(
    1208         encode('iso-8859-1', $file_out)
     1206        $file_out
    12091207    );     
    12101208printf("gravity %s, color %s, pointsize %s, x %s, y %s\n", $gravity, $fill, $text_size, $x, $y);   
     
    12261224            "%s:%s",
    12271225            $self->type,
    1228             encode('iso-8859-1', $file_out),
     1226            $file_out,
    12291227        )
    12301228    );
     
    13111309        # write resizd file
    13121310        $image->Write(
    1313             filename=>encode('iso-8859-1', $file)
     1311            $file
    13141312        );
    13151313        warn "$status ", $file, "\n" if $status ;
  • extensions/pLoader/trunk/src/Uploader/PWG/WebServices.pm

    r4097 r4121  
    2828use Digest::MD5::File qw/file_md5_hex md5_hex/;
    2929use File::Slurp;
    30 use Encode qw/encode decode is_utf8/;
    3130use POSIX qw(ceil floor);
    3231use base qw/
     
    242241    eval {
    243242        $file_sum = file_md5_hex(
    244             encode('iso-8859-1', $self->site_resized_file)
     243            $self->site_resized_file
    245244        );
    246245    };
     
    248247
    249248    my $thumbnail_sum = file_md5_hex(
    250         encode('iso-8859-1', $self->site_thumb_file),
     249        $self->site_thumb_file,
    251250    );
    252251
    253252    my $original_sum = file_md5_hex(
    254         encode('iso-8859-1', $self->site_high_file)
     253        $self->site_high_file
    255254    );
    256255
     
    272271        };
    273272
    274     my $site_image_name = is_utf8($self->site_image_name) ?
    275                                   $self->site_image_name :
    276                                   encode('utf8', $self->site_image_name);
     273    my $site_image_name = $self->site_image_name;
    277274
    278275    my $image_id = $hresult->{result}{$original_sum};
     
    284281               
    285282            my $resized_params = {
    286                 filepath => encode('iso-8859-1', $self->site_resized_file),
    287                 type => 'file',
    288                 original_sum => $original_sum,
     283                filepath       => $self->site_resized_file,
     284                type           => 'file',
     285                original_sum   => $original_sum,
    289286                yield_callback => $yield_callback,
    290287            };
     
    299296         
    300297            my $thumb_params = {
    301                 filepath => encode('iso-8859-1', $self->site_thumb_file),
    302                 type => 'thumb',
    303                 original_sum => $original_sum,         
     298                filepath       => $self->site_thumb_file,
     299                type           => 'thumb',
     300                original_sum   => $original_sum,               
    304301                yield_callback => $yield_callback,
    305302            };
     
    329326            };
    330327            my $high_params = {
    331                 filepath => encode('iso-8859-1', $self->site_high_file),
    332                 type => 'high',
    333                 original_sum => $original_sum,
     328                filepath       => $self->site_high_file,
     329                type           => 'high',
     330                original_sum   => $original_sum,
    334331                yield_callback => $yield_callback,
    335332            };
Note: See TracChangeset for help on using the changeset viewer.