Changeset 3163


Ignore:
Timestamp:
02/22/09 23:08:42 (11 years ago)
Author:
ronosman
Message:

Test exif preview image before using it for wxthumbnail creation.

Location:
extras/pLoader/trunk/src/Uploader
Files:
2 edited

Legend:

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

    r3159 r3163  
    722722            width     => $w, 
    723723            height    => $h, 
    724             title     => "pLoader - Piwigo uploader 2.0.0a - [$url]" , 
     724            title     => "pLoader - Piwigo uploader 2.0.0b - [$url]" , 
    725725            pwg       => $self->pwg, 
    726726            imagelist => $self->imagelist, 
  • extras/pLoader/trunk/src/Uploader/ImageList.pm

    r3159 r3163  
    205205        $self->_set_current_image_filepaths(); 
    206206 
    207          
    208         # an exif preview is available. we use it 
    209         if(defined $info->{PreviewImage}){ 
     207        my $create_gui_preview;         
     208        # an exif preview is available. we try to use it 
     209        if(defined $info->{PreviewImage} ){ 
    210210            printf("use preview\n"); 
    211211            $self->_write_preview_image( $info->{PreviewImage} ); 
     212            my $image = new Image::Magick; 
     213            eval { 
     214                $create_gui_preview = $image->ReadImage( 
     215                    $self->current_image->preview_file 
     216                ); 
     217            }; 
     218            unlink $self->current_image->preview_file if $create_gui_preview; 
     219        }else { 
     220            $create_gui_preview = 1; 
    212221        } 
     222        print $create_gui_preview, "\n"; 
    213223        # have to create a preview file 
    214         else { 
    215             printf("have to create a preview\n"); 
     224        if($create_gui_preview) { 
    216225            eval { 
    217226                if(!$self->CreateGUIPreview()){ 
    218             printf("use preview callback\n"); 
    219227                    # use method provided by the caller 
    220228                    # source, target, type, ratio 
Note: See TracChangeset for help on using the changeset viewer.