Ignore:
Timestamp:
Mar 2, 2010, 10:55:56 AM (15 years ago)
Author:
ronosman
Message:

Feature 1446 added : transmit the original filename.

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

Legend:

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

    r4779 r5020  
    3232        site_author
    3333        site_comment
     34        site_original_filename
    3435        exif_metadata
    3536        add_rank
  • extensions/pLoader/trunk/src/Uploader/ImageList.pm

    r4803 r5020  
    12041204            $self->current_image->file
    12051205        );
    1206    
     1206       
     1207        $self->current_image->site_original_filename(
     1208            $file
     1209        );
    12071210        my ( $filename, $ext ) = split /\./, $file ;
    12081211   
     
    12201223}
    12211224
     1225
     1226
    12221227sub CreateWatermark {
    12231228    my ( $self, $text, $text_size, $position, $x, $y, $color, $file_out ) = @_;
     
    12641269    # set default values only if not defined
    12651270    # || operator is not used because 0 is a choice value
    1266     # and woukd replace a valid choice with a default value
     1271    # and would replace a valid choice with a default value
    12671272    $self->reupload_action_files(1)
    12681273        unless defined $self->reupload_action_files;
     
    12921297        $self->current_image->site_high_file
    12931298    );
     1299
     1300    $self->pwg->site_original_filename(
     1301        $self->current_image->site_original_filename
     1302    );
     1303
    12941304
    12951305    $self->pwg->site_resized_file(
  • extensions/pLoader/trunk/src/Uploader/PWG/WebServices.pm

    r4779 r5020  
    4747           tags
    4848           categories
     49           site_original_filename
    4950           site_high_file
    5051           site_resized_file
     
    227228        );
    228229    };
    229 
    230230    if($@){
    231231        printf("An error occured in post execution %s\n%s",
     
    294294                my $rval = $self->_send_chunks($_, $progress);
    295295                $status_line = $rval->{message};
    296                 last UPLOAD if !$rval->{ok};
     296                if (!$rval->{ok}){
     297                    $status = 0;
     298                    last UPLOAD ;
     299                }
    297300            } @types;
    298301         
     
    301304                method            => 'pwg.images.add',
    302305                original_sum      => $self->sum->{original},
     306                original_filename => $self->site_original_filename,
    303307                file_sum          => $self->sum->{file},
    304308                thumbnail_sum     => $self->sum->{thumb},
     
    639643        );
    640644        $chunk_pos += $self->chunk_size;
     645        #print "pwg.images.addChunk\n";
     646        my $data = encode_base64($chunk);
     647        #printf("chunk : %s, data %s\n", length $chunk, length $data);
    641648        my $response = $self->uagent->post(
    642649            $self->urlbase.'/ws.php?format=json',
    643650            {
    644651                method       => 'pwg.images.addChunk',
    645                 data         => encode_base64($chunk),
     652                data         => $data,
    646653                original_sum => $params->{original_sum},
    647654                position     => $chunk_id,
     
    649656            }
    650657        );
     658#print Dumper $response;
    651659        $yield->();
    652660        $progress->{bar}->(100*($chunk_pos/$content_length));
Note: See TracChangeset for help on using the changeset viewer.