Changeset 15327 for trunk


Ignore:
Timestamp:
May 26, 2012, 12:05:24 PM (12 years ago)
Author:
plg
Message:

piwigo_remote.pl: simplified use of pwg.images.add, no longer need thumb and high

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/piwigo_remote.pl

    r4348 r15327  
    44# Usage examples
    55#
    6 # time perl piwigo_remote.pl \
    7 #   --action=pwg.images.add \
    8 #   --file=erwann_rocher-web.jpg \
    9 #   --thumb=erwann_rocher-thumb.jpg \
    10 #   --high=erwann_rocher-high.jpg \
    11 #   --original=erwann_rocher-high.jpg \
    12 #   --define categories=9 \
    13 #   --chunk_size=200_000
     6# perl piwigo_remote.pl --action=pwg.images.add --file=erwann_rocher-web.jpg --define categories=9
    147
    158use strict;
     
    2922          action=s
    3023          file=s
    31           thumbnail=s
    32           high=s
    3324          original=s
    3425          categories=s
     
    8980    $form->{method} = $opt{action};
    9081
    91     my $original_sum = file_md5_hex($opt{original});
     82    my $original = $opt{file};
     83    if (defined $opt{original}) {
     84        $original = $opt{original};
     85    }
     86
     87    my $original_sum = file_md5_hex($original);
    9288    $form->{original_sum} = $original_sum;
    9389
     
    9894    );
    9995    $form->{file_sum} = file_md5_hex($opt{file});
    100 
    101     send_chunks(
    102         filepath => $opt{thumbnail},
    103         type => 'thumb',
    104         original_sum => $original_sum,
    105     );
    106     $form->{thumbnail_sum} = file_md5_hex($opt{thumbnail});
    107 
    108     if (defined $opt{high}) {
    109         send_chunks(
    110             filepath => $opt{high},
    111             type => 'high',
    112             original_sum => $original_sum,
    113         );
    114         $form->{high_sum} = file_md5_hex($opt{high});
    115     }
    11696
    11797    foreach my $key (keys %{ $opt{define} }) {
Note: See TracChangeset for help on using the changeset viewer.