Changeset 3065 for trunk


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.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/ws_functions.inc.php

    r3049 r3065  
    910910    COUNT(*) AS counter
    911911  FROM '.IMAGES_TABLE.'
    912   WHERE md5sum = \''.$params['file_sum'].'\'
     912  WHERE md5sum = \''.$params['original_sum'].'\'
    913913;';
    914914  list($counter) = mysql_fetch_row(pwg_query($query));
     
    10891089    'width' => $width,
    10901090    'height' => $height,
    1091     'md5sum' => $params['file_sum'],
     1091    'md5sum' => $params['original_sum'],
    10921092    );
    10931093
  • 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) {
  • trunk/ws.php

    r3049 r3065  
    183183      'high_content' => array('default' => null),
    184184      'high_sum' => array('default' => null),
     185      'original_sum' => array(),
    185186      'name' => array('default' => null),
    186187      'author' => array('default' => null),
Note: See TracChangeset for help on using the changeset viewer.