Changeset 3065 for trunk/tools


Ignore:
Timestamp:
Jan 9, 2009, 12:33:35 AM (15 years ago)
Author:
plg
Message:

merge r3064 from branch 2.0 to trunk

bug 912 fixed: we need an extra original_sum to pwg.images.add API method to
check photo existence. Using the file_sum was a bad idea.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/piwigo_remote.pl

    r2919 r3065  
    1212GetOptions(
    1313    \%opt,
    14     qw/action=s file=s thumbnail=s high=s categories=s define=s%/
     14    qw/action=s file=s thumbnail=s high=s original=s categories=s define=s%/
    1515);
    1616
     
    4949    use File::Slurp;
    5050
     51    my $original_sum = file_md5_hex($opt{original});
     52
    5153    my $file_content = encode_base64(read_file($opt{file}));
    5254    my $file_sum = file_md5_hex($opt{file});
     
    5759    $form = {
    5860        method => 'pwg.images.add',
     61        original_sum => $original_sum,
    5962        file_sum => $file_sum,
    6063        file_content => $file_content,
     
    8588
    8689#     use Data::Dumper;
    87 #     print Dumper($response);
     90#     print Dumper($response->content);
     91#     print Dumper(from_json($response->content));
    8892
    8993    if ($response->is_success) {
Note: See TracChangeset for help on using the changeset viewer.