Trying to Batch file name to photo caption

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, helmut, xnview

Post Reply
pondball
Posts: 5
Joined: Sun Nov 20, 2022 7:31 pm

Trying to Batch file name to photo caption

Post by pondball »

I help produce slideshows at a photo club.
We have 3 category folders in Dropbox so members can submit 3 photos each, with on average 29 members in our club, so each month we will have up to 180 photos to process.

Members submit their photos with the file name as they would like it to be used as the title of the photo when shown in the slideshow. Ie WinterBlues.jpg will show as the title Winter Blues in a specific location on their photo when shown in the slideshow.

I have searched and tested everything except Adobe products to try and get the file name to show as a photo title (caption?) in the slideshow once I input the file into that same slideshow. So far, all I can do is create a title for each individual photo - manually - and that’s just not going to happen.

I’ve been through the docs and numerous YT videos to see if XnView MP will do this in a bath a process, preferably by each folder that houses 60 photos each) but can’t find anything that suggests it can actually do that. Hopefully someone can point me to a video (or 2) that explains the process, if this is possible. Thanks in advance, Dan.
cday
XnThusiast
Posts: 3976
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Trying to Batch file name to photo caption

Post by cday »

I have had a look and don't see a way of doing that currently using XnView MP or XnConvert (a standalone batch convert software nominally identical the 'MP Batch convert), or directly using the command line software utility NConvert (it could be possible using a multi-line script).

However, I think that the function could probably be fairly easily added, and could be a useful addition... :D

I assume that you wish to add the file title to the image canvas, either on the existing image, or possibly better on new canvas added below the image in a previous batch action. Note that the text would be 'burnt in' to the image and not editable, although copies of the original images could always be archived for later use if required.

Thinking of other actions where file parameters from a drop-down list can be used as inputs, I think that the same option could probably be fairly easily added to this XnConvert [for illustration] action:

Screenshot from 2022-11-20 20-31-32.png

Pierre, the sole developer of all XnView software, does currently have a high workload, though... :wink:

Note: There was a somewhat similar request a few years back, I don't recall the full details and don't have XnTriq's search skills, but it might worth trying to locate it. Possibly there may already be a way of doing what you need??
pondball
Posts: 5
Joined: Sun Nov 20, 2022 7:31 pm

Re: Trying to Batch file name to photo caption

Post by pondball »

Thanks for the quick reply.
I’m absolutely amazed that more presentation apps don’t have this function built in… using the file name as a title or watermark.
Seems like such a natural thing for slideshows and movies. And would save a ton of time.
The only issue with batch watermarks is that if the norm is a white watermark it might work for some photos but on others it would be a 🤷 what watermark moment.
And yup… always on a copy!
Thanks again, Dan.
User avatar
michel038
XnThusiast
Posts: 1285
Joined: Tue Sep 27, 2016 8:18 am
Location: France
Contact:

Re: Trying to Batch file name to photo caption

Post by michel038 »

I think it's possible to add the filename in an area added to a photo... I'll have a look tomorrow...
User avatar
michel038
XnThusiast
Posts: 1285
Joined: Tue Sep 27, 2016 8:18 am
Location: France
Contact:

Re: Trying to Batch file name to photo caption

Post by michel038 »

1 If you want to use the slideshow tool of xnviewmp
- Select pictures
- Create > Slideshow
- Settings , select {filename} with "Insert" button ...
- Adjust other settings ...

2 If you use another software for slideshow
2a - if this soft uses a metadata such as "iptc title" (or any other) as a title in the slideshow :
- You can use a workaround that I can explain in detail if you want , to copy filenames in the requested metadata field...
tell us which metadata should be chosen.

2b - If this software can't use any metadata, you can copy filenames in an new area below the displayed photo :
- Select pictures
- Tools > batch convert > Actions > Add action > Image > Canvas resize ...
Check "relative " and "keep ratio" , add for example 100 pixels height, position top left , choose background color , and see if preview is ok.
- Actions > Add action > Image > Text
With the right arrow menu of text field, select Filename without extension. Adjust font size, position, font color (!) , ... , see if preview is ok .
- Select the output folder in "Output" tab, and see also all other settings .
- "Convert"
cday
XnThusiast
Posts: 3976
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Trying to Batch file name to photo caption

Post by cday »

michel038 wrote: Mon Nov 21, 2022 10:59 am 1 If you want to use the slideshow tool of xnviewmp
- Select pictures
- Create > Slideshow
- Settings , select {filename} with "Insert" button ...
- Adjust other settings ...
Slideshow.png

I don't use the browser Slideshow function, that looks a good start, but is there any control over where the text is placed on the image?

Assuming there is, presumably if desired the filename could be placed below the image on new canvas previously added in a batch canvas resize.

the filename could be

2 If you use another software for slideshow:

2b - If this software can't use any metadata, you can copy filenames in an new area below the displayed photo :
- Select pictures
- Tools > batch convert > Actions > Add action > Image > Canvas resize ...
Check "relative " and "keep ratio" , add for example 100 pixels height, position top left , choose background color , and see if preview is ok.
- Actions > Add action > Image > Text
With the right arrow menu of text field, select Filename without extension. Adjust font size, position, font color (!) , ... , see if preview is ok .
- Select the output folder in "Output" tab, and see also all other settings .
- "Convert"

I don't see that option that I was looking for before, see the screenshot in my first post... A screenshot?

The previous request to add captions that I referred to above only required a caption that could be entered by hand for each image, if I found the correct thread. I can, however, now confirm that it should be possible to use a small NConvert batch file to add the filenames as captions to a batch of images.

I think that a batch convert 'Add text' option to use the filename text could still be a useful option that could probably be easily added: a checkbox 'Use filename' rather than a drop-down with a long list of options would probably be sufficient, possibly with an option to include the extension.
pondball
Posts: 5
Joined: Sun Nov 20, 2022 7:31 pm

Re: Trying to Batch file name to photo caption

Post by pondball »

All good tips @cday and @michelO38
I’ll have to do a couple of reads of these and some testing to see if it will produce the results my photo group is looking for.
Thanks again!
User avatar
michel038
XnThusiast
Posts: 1285
Joined: Tue Sep 27, 2016 8:18 am
Location: France
Contact:

Re: Trying to Batch file name to photo caption

Post by michel038 »

cday wrote: Mon Nov 21, 2022 11:41 am
- (...) use the browser Slideshow function, that looks a good start, but is there any control over where the text is placed on the image?
(...)
- I don't see that option that I was looking for before, see the screenshot in my first post... A screenshot?
- In your 2nd screenshot for XnViewMP slideshow , is "Position : top left" the control you are looking for ?

- In your 1st screenshot, the horizontal scrolling seems buggy, you should see the arrow menu near the "Text" field ...
.
Convert1.jpg
cday
XnThusiast
Posts: 3976
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Trying to Batch file name to photo caption

Post by cday »

michel038 wrote: Mon Nov 21, 2022 3:30 pm
- In your 2nd screenshot for XnViewMP slideshow , is "Position : top left" the control you are looking for ?

- In your 1st screenshot, the horizontal scrolling seems buggy, you should see the arrow menu near the "Text" field ...
Rechecking, in both the current version of XnView MP 1.3.1 and the latest version of XnConvert 1.96, it is necessary to drag the relevant window unusually wide to see the full interface, never seen that before...

So good news for pondball? :D
pondball
Posts: 5
Joined: Sun Nov 20, 2022 7:31 pm

Re: Trying to Batch file name to photo caption

Post by pondball »

Could be, cday!
just to clarify, looks like I would need both apps to make this work?
XnView Mp and XnConvert?
cday
XnThusiast
Posts: 3976
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Trying to Batch file name to photo caption

Post by cday »

pondball wrote: Mon Nov 21, 2022 4:15 pm just to clarify, looks like I would need both apps to make this work?
XnView MP and XnConvert?
No, either:

XnView MP is a general purpose file browser and editor that includes a batch convert function, XnConvert is a very neat stand-alone batch conversion software that is nominally the batch convert function in 'MP. Due to different update cycles, sometimes there are limited differences between the two, with a new capability or bug fix introduced in one before the other.

Depends if you need 'MP's general browser/editor functions, if not I would go for XnConvert... :D
pondball
Posts: 5
Joined: Sun Nov 20, 2022 7:31 pm

Re: Trying to Batch file name to photo caption

Post by pondball »

Thanks for the clarification, cday!
👍🏻
User avatar
XnTriq
Moderator & Librarian
Posts: 6336
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Trying to Batch file name to photo caption

Post by XnTriq »

cday wrote: Sun Nov 20, 2022 8:51 pmThere was a somewhat similar request a few years back, I don't recall the full details and don't have XnTriq's search skills, but it might worth trying to locate it. Possibly there may already be a way of doing what you need??
Post Reply