Announcement

#1 2022-07-20 13:35:19

iconberg
Member
2016-02-24
20

images.addSimple documentation wrong???

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

 

#2 2022-07-20 14:08:40

erAck
Only trying to help
2015-09-06
2023

Re: images.addSimple documentation wrong???

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.


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2022-07-20 14:49:50

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: images.addSimple documentation wrong???

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

 

#4 2022-07-20 14:51:19

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: images.addSimple documentation wrong???

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

 

#5 2022-07-20 15:57:41

iconberg
Member
2016-02-24
20

Re: images.addSimple documentation wrong???

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

 

#6 2022-07-21 12:19:22

iconberg
Member
2016-02-24
20

Re: images.addSimple documentation wrong???

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

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact