Hello,
it seems the docs for images.addSimple are different in "tools/ws.htm" and https://piwigo.org/doc/doku.php?id=dev: … .addsimple
tools/ws.html says image_id is an integer,
doku.php image is an path to file.
Which is correct?
And can images.addSimple be used to associate an already existing image to an album?
Offline
Those docs are hopelessly outdated and incomplete, that specific doc page appears to be even only a proposal ("we propose a simpler method"), if in doubt then tools/ws.htm is current.
Offline
The documentation is not wrong, but not up-to-date. Indeed, you're comparing the "image" parameter with the "image_id" parameter. That's not the same.
Anyway, as erAck said, tools/ws.htm will always provide the right information. By design.
Offline
iconberg wrote:
And can images.addSimple be used to associate an already existing image to an album?
That's not the right API method for that purpose. pwg.images.setInfo is the way to go. There you have a "categories" parameter.
Offline
Thanks for the info, i try to add a catagory and result is "ok" but the category is not added.
The ws.htm says
"multiple_value_mode can be "append" (no change on existing values, add the new values) or "replace" and applies to multiple values properties like tag_ids/categories."
I try:
https://www.xxxxxxxxxxxxxxxxxx/ws.php?format=rest
{
"image_id": "57941",
"categories": "1643",
"multiple_value_mode": "append"
}
<rsp stat="ok"> </rsp>
The categories are unchanged before and after setting there are only the already existing ones.
I guess i have to read the string add myself and do a "replace"? Or is the call wrong?
Last edited by iconberg (2022-07-21 13:42:41)
Offline
As i look today the picture is there,
i guess the image.getInfo was not rerun do no changes or get an proxy cache result.
Offline