Piwigo Bugtracker

Piwigo bug tracker has moved to Github

This bugtracker is kept to provide history on old issues.


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001051Piwigoweb APIpublic2009.07.14 22:192009.11.23 01:15
Reporterplg 
Assigned Toplg 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version2.0.3 
Target Version2.0.4Fixed in Version2.0.7 
Summary0001051: upload photo more than once
DescriptionOn topic:15172, we have discussed about the ability in pLoader to re-upload a photo. To add the high resolution or because the resizing settings have changed.

plg wrote:

> OK, interesting improvement. First Piwigo identifies the photo, then Piwigo
> compares the md5sum of each file (3 files come with a md5sum to check that
> upload was successful). If the md5sum differs, the file is overwritten.

ron wrote:

> Current API pwg.images.exist uses the original photo md5 checksum. I agree
> that it should also take thumbnail and resized md5 checksum as parameters. It
> should return which md5 is different in order to tell to pLoader which file
> has to be sent.


At least pwg.images.exist and pwg.images.add must be changed to handle this feature request.
TagsNo tags attached.
browserany
Database engine and version
PHP version
Web serverApache 1.3.x
Attached Files

- Relationships
related to 0001052resolvedrosman pLoader support photo re-upload 

-  Notes
(0003098)
svn (reporter)
2009.11.20 22:19

[Subversion] r4328 by plg on branch 2.0

-----[Subversion commit log]----------------------------------------------------
improvement: to prepare feature 1051, the code to add a single file (works for
the 3 picture types, ie thumb/file/high) has been factorized into a single
add_file function.

bug fixed: when a function not directly called by the API (such as merge_chunks
or the new add_file function) returning a PwgError, it was not stopping the
execution, it just sets the error code/message. Now we don't return PwgError,
we only create one and then exit().
(0003107)
svn (reporter)
2009.11.22 23:09

[Subversion] r4344 by plg on branch 2.0

-----[Subversion commit log]----------------------------------------------------
feature 1051: new API method pwg.images.checkFiles. This method will be useful
before asking for an update on photo files.

Enhancement in code factorization.
(0003108)
svn (reporter)
2009.11.23 00:38

[Subversion] r4345 by plg on branch 2.0

-----[Subversion commit log]----------------------------------------------------
feature 1051: ability to add/update a file for an existing photo. For example,
you can add the "high" later. Another example is to update the "web resized"
file (new dimensions is a common example). It also works for thumbnails.
Updating an existing file has no impact on the logical level (list of tags,
list of categories, title, description and so on).
(0003109)
svn (reporter)
2009.11.23 00:57

[Subversion] r4346 by plg on trunk

-----[Subversion commit log]----------------------------------------------------
merge r4328 from branch 2.0 to trunk

improvement: to prepare feature 1051, the code to add a single file (works for
the 3 picture types, ie thumb/file/high) has been factorized into a single
add_file function.

bug fixed: when a function not directly called by the API (such as merge_chunks
or the new add_file function) returning a PwgError, it was not stopping the
execution, it just sets the error code/message. Now we don't return PwgError,
we only create one and then exit().
(0003110)
svn (reporter)
2009.11.23 00:58

[Subversion] r4347 by plg on trunk

-----[Subversion commit log]----------------------------------------------------
merge r4344 from branch 2.0 to trunk

feature 1051: new API method pwg.images.checkFiles. This method will be useful
before asking for an update on photo files.

Enhancement in code factorization.
(0003111)
svn (reporter)
2009.11.23 00:59

[Subversion] r4348 by plg on trunk

-----[Subversion commit log]----------------------------------------------------
merge r4345 from branch 2.0 to trunk

feature 1051: ability to add/update a file for an existing photo. For example,
you can add the "high" later. Another example is to update the "web resized"
file (new dimensions is a common example). It also works for thumbnails.
Updating an existing file has no impact on the logical level (list of tags,
list of categories, title, description and so on).
(0003112)
plg (manager)
2009.11.23 01:06

So, here comes the HOWTO. I've added pwg.images.checkFiles and pwg.images.addFile actions.

As the self decsription for pwg.images.checkFiles says:

> check if you have updated version of your files for a given photo,
> for each requested file type, the answer can be "missing", "equals"
> or "differs"

The pwg.images.addFile can be called without using pwg.images.checkFiles before, by default the files are overwritten, so you can overwrite a file with the same file, it's just stupid :-) so please, to avoid bandwidth load, check before sending data on the network!

pwg.images.addFile is a light weight pwg.images.add : no logical info, single file. You have to tell which file type you're sending amon thumbnail/file/high. You must have sent data with pwg.images.addChunk before. pwg.images.addFile "only" perform checks, a call to merge_chunks and a database update if required.

Of course, tools/piwigo_remote.pl has been updated to give a real example of how to use these new web API methods.

- Issue History
Date Modified Username Field Change
2009.07.14 22:19 plg New Issue
2009.07.14 22:19 plg Status new => assigned
2009.07.14 22:19 plg Assigned To => plg
2009.07.14 22:19 plg browser => any
2009.07.14 22:19 plg Web server => Apache 1.3.x
2009.07.14 22:21 plg Relationship added related to 0001052
2009.11.20 22:19 svn Checkin
2009.11.20 22:19 svn Note Added: 0003098
2009.11.22 23:09 svn Checkin
2009.11.22 23:09 svn Note Added: 0003107
2009.11.23 00:38 svn Checkin
2009.11.23 00:38 svn Note Added: 0003108
2009.11.23 00:57 svn Checkin
2009.11.23 00:57 svn Note Added: 0003109
2009.11.23 00:58 svn Checkin
2009.11.23 00:58 svn Note Added: 0003110
2009.11.23 00:59 svn Checkin
2009.11.23 00:59 svn Note Added: 0003111
2009.11.23 01:06 plg Note Added: 0003112
2009.11.23 01:15 plg Status assigned => closed
2009.11.23 01:15 plg Resolution open => fixed
2009.11.23 01:15 plg Fixed in Version => 2.0.7


Copyright © 2000 - 2018 MantisBT Team
Contact
Powered by Mantis Bugtracker