diff options
author | plegall <plg@piwigo.org> | 2012-05-26 10:05:24 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2012-05-26 10:05:24 +0000 |
commit | 314dde208c896aa970300528ad92cc2452321616 (patch) | |
tree | 7c50508eb775701e2c43a16d2e36eb397955b9e5 | |
parent | e5f1cf22e9fbdd208a5f79b149280d1e2613175a (diff) |
piwigo_remote.pl: simplified use of pwg.images.add, no longer need thumb and high
git-svn-id: http://piwigo.org/svn/trunk@15327 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | tools/piwigo_remote.pl | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/tools/piwigo_remote.pl b/tools/piwigo_remote.pl index 8c8098daf..5cc9193e5 100644 --- a/tools/piwigo_remote.pl +++ b/tools/piwigo_remote.pl @@ -3,14 +3,7 @@ #### # Usage examples # -# time perl piwigo_remote.pl \ -# --action=pwg.images.add \ -# --file=erwann_rocher-web.jpg \ -# --thumb=erwann_rocher-thumb.jpg \ -# --high=erwann_rocher-high.jpg \ -# --original=erwann_rocher-high.jpg \ -# --define categories=9 \ -# --chunk_size=200_000 +# perl piwigo_remote.pl --action=pwg.images.add --file=erwann_rocher-web.jpg --define categories=9 use strict; use warnings; @@ -28,8 +21,6 @@ GetOptions( qw/ action=s file=s - thumbnail=s - high=s original=s categories=s chunk_size=i @@ -88,7 +79,12 @@ if ($opt{action} eq 'pwg.images.add') { $form = {}; $form->{method} = $opt{action}; - my $original_sum = file_md5_hex($opt{original}); + my $original = $opt{file}; + if (defined $opt{original}) { + $original = $opt{original}; + } + + my $original_sum = file_md5_hex($original); $form->{original_sum} = $original_sum; send_chunks( @@ -98,22 +94,6 @@ if ($opt{action} eq 'pwg.images.add') { ); $form->{file_sum} = file_md5_hex($opt{file}); - send_chunks( - filepath => $opt{thumbnail}, - type => 'thumb', - original_sum => $original_sum, - ); - $form->{thumbnail_sum} = file_md5_hex($opt{thumbnail}); - - if (defined $opt{high}) { - send_chunks( - filepath => $opt{high}, - type => 'high', - original_sum => $original_sum, - ); - $form->{high_sum} = file_md5_hex($opt{high}); - } - foreach my $key (keys %{ $opt{define} }) { $form->{$key} = $opt{define}{$key}; } |