[web API] pwg.images.setInfo - 'name' parameter changes original filename #940

Closed
opened 2026-10-05 00:24:43 +02:00 by adam · 3 comments
Owner
  • When calling pwg.images.setInfo with an image_id and a name parameter with value Bateau, the method sets the title as expected but it also replaces the original filename of the image with Bateau (seen on the web GUI and the mobile app). The call also returns a non JSON response leading to an error (checked with both JPEG and PNG formats).
  • If I add the file parameter with the value image.jpg to the above request, the method does the same, i.e. set the original filename to Bateau.jpg, but does not return a non JSON response (tested with both PNG and JPEG files). If the name value contains spaces, the original filename looses its extension.
  • When calling pwg.images.setInfo with an image_id and a file parameter with value e.g. image.jpg, the method sets the original filename even if the parameter single_value_mode is not provided with the replace value (as expected).

This is really annoying, in particular when the original filename lost its extension. The workaround is to call the method twice to change the title. Could this be fixed?

- When calling `pwg.images.setInfo` with an `image_id` and a `name` parameter with value `Bateau`, the method sets the title as expected but it also replaces the original filename of the image with `Bateau` (seen on the web GUI and the mobile app). The call also returns a non JSON response leading to an error (checked with both JPEG and PNG formats). - If I add the `file` parameter with the value `image.jpg` to the above request, the method does the same, i.e. set the original filename to `Bateau.jpg`, but does not return a non JSON response (tested with both PNG and JPEG files). If the `name` value contains spaces, the original filename looses its extension. - When calling `pwg.images.setInfo` with an `image_id` and a `file` parameter with value e.g. `image.jpg`, the method sets the original filename even if the parameter `single_value_mode` is not provided with the `replace` value (as expected). This is really annoying, in particular when the original filename lost its extension. The workaround is to call the method twice to change the title. Could this be fixed? <!-- github-sync-id:493969095 -->
adam closed this issue 2026-10-05 00:24:43 +02:00
Author
Owner

Hi @EddyLB

When calling pwg.images.setInfo with an image_id and a name
parameter with value Bateau, the method sets the title as expected
but it also replaces the original filename of the image with Bateau

I can't reproduce that. I have tried with tools/ws.htm and it works as expected :-/

If I add the file parameter with the value image.jpg to the above
request, the method does the same, i.e. set the original filename to
Bateau.jpg

Can't reproduce that either :-/ And no problem to set a "file" to "a file name with spaces.jpg".

When calling pwg.images.setInfo with an image_id and a file
parameter with value e.g. image.jpg, the method sets the original
filename even if the parameter single_value_mode is not provided
with the replace value (as expected).

I reproduce that. The update of the file property does not take the single_value_mode into account. It can be fixed.

Hi @EddyLB > When calling `pwg.images.setInfo` with an `image_id` and a `name` > parameter with value `Bateau`, the method sets the title as expected > but it also replaces the original filename of the image with `Bateau` I can't reproduce that. I have tried with `tools/ws.htm` and it works as expected :-/ > If I add the `file` parameter with the value `image.jpg` to the above > request, the method does the same, i.e. set the original filename to > `Bateau.jpg` Can't reproduce that either :-/ And no problem to set a "file" to "a file name with spaces.jpg". > When calling `pwg.images.setInfo` with an `image_id` and a `file` > parameter with value e.g. `image.jpg`, the method sets the original > filename even if the parameter `single_value_mode` is not provided > with the `replace` value (as expected). I reproduce that. The update of the `file` property does not take the `single_value_mode` into account. It can be fixed. <!-- github-comment-id:533598794 -->
Author
Owner

Thanks for your reply. I did not know I could use tools/ws.htm which simplifies life a lot (was typing URLs directly). That means that I must now investigate the library I use to prepare the JSON block sent to the server. First time I encounter such a problem with it :=(

Thanks for your reply. I did not know I could use tools/ws.htm which simplifies life a lot (was typing URLs directly). That means that I must now investigate the library I use to prepare the JSON block sent to the server. First time I encounter such a problem with it :=( <!-- github-comment-id:533628456 -->
Author
Owner

Solved. The problem was caused by the Autocorrect Filename plugin. Once deactivated, no more issue ;-)

Solved. The problem was caused by the Autocorrect Filename plugin. Once deactivated, no more issue ;-) <!-- github-comment-id:533798969 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#940