Search…

X3 Photo Gallery Support Forums

Search…
 
utopia
Topic Author
Posts: 9
Joined: 30 Jul 2024, 02:38

Batch renaming image files in X3

Yesterday, 07:18

I would like to rename hundreds of image files on my X3 website. If I do this manually via the X3 panel, it takes a very long time because the panel needs at least a minute (usually more) for each rename operation. Would it be possible to download the associated page.json file via FTP while the X3 panel is open, edit the image names in a text editor, upload the modified JSON file again via FTP, remove all existing images, and then re-upload them with the new names?

[font={defaultattr}]For example: replace names like [/font]PatrouilleSuisse_TK_2025_0001.jpg, etc., with names like patrouille-suisse-tk-2025-001.jpg, etc.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14460
Joined: 30 Sep 2006, 03:37

Re: Batch renaming image files in X3

Yesterday, 22:17

utopia wrote:Would it be possible to download the associated page.json file via FTP while the X3 panel is open, edit the image names in a text editor, upload the modified JSON file again via FTP, remove all existing images, and then re-upload them with the new names?

The page.json file only contains references to your images, so you can't edit the file names from the page.json. The original image names will be the names of the physical image files in the dir. But i'm guessing you are asking about this because you also have various titles and descriptions saved for each image? If not, then of course you could just remove all, and then re-upload with correct names.

Yes, you could download the page.json edit names and re-upload the file, AFTER you have re-uploaded the images with the correct file names.

I'm not 100% sure I understood your issue, but I am guessing it's the above. If you wanted to renaming files based on a pattern, it would be useful with a batch renaming script, but that would only work from SSH/terminal.