Page 1 of 1

Rename photos with EXIF

Posted: Wed Apr 07, 2021 2:48 pm
by Mambobuzzz
Hi,

many thanks for the great software that I've gladly used over many years! :)

I'm trying now something quite easy, renaming photos with EXIF data. I've tried this:

nconvert.exe -o $EXIF:DateTaken["%F"] *.jpg

But nothing appends. Documentation didn't help. Can someone please help me?

Mambobuzzz

Re: Rename photos with EXIF

Posted: Thu Apr 08, 2021 7:33 am
by xnview
%F is not recognize on Windows, please use $EXIF[%Y-%m-%d]

Re: Rename photos with EXIF

Posted: Sat Oct 30, 2021 4:49 pm
by tomv
Hi there, I'm trying to use this code from a bath file in windows 10, NCONVERT v7.95:

.\NConvert\nconvert -o $EXIF:DateTaken[%%Y%%m%%d-%%H%%M%%S]_%% -keep_icc -ratio -rtype hanning -rflag decr -resize shortest 1500 -D -overwrite "..\*.png" "..\*.jpg" "..\*.jpeg"

the problems I have are:

1) the converted files are saved in the directory of the batch script, not in the upper directory ..\ where are the original files
2) when the original files are .png as EXIF info I have the filename
3) I want to separate the EXIF info from the filename with _ but I'm not able...

the original file names I have are:

IMG_3173.JPG
IMG_3174.JPG
IMG_3175.PNG
IMG_3177.PNG
IMG_3176.PNG

and the ouput file names are:

mIMG_3175d-IMG_3175HIMG_3175MIMG_3175S]_IMG_3175.png
mIMG_3176d-IMG_3176HIMG_3176MIMG_3176S]_IMG_3176.png
20211018-121005IMG_3173.jpg
mIMG_3177d-IMG_3177HIMG_3177MIMG_3177S]_IMG_3177.png
20211018-121430IMG_3174.jpg

help or suggestions will be appreciated!

best regards

Re: Rename photos with EXIF

Posted: Sat Oct 30, 2021 5:27 pm
by tomv
well, for the problem 3) I found that I can scape the character with $_ but now don't save the .png files

Error: Can't create file (mIMG_3177d-IMG_3177HIMG_3177MIMG_3177S]C:\Users\noadmin\Desktop\Nueva carpeta\Nueva carpeta\-IMG_3177.png)

Re: Rename photos with EXIF

Posted: Tue Nov 02, 2021 9:34 am
by xnview
you need to use

Code: Select all

-o ..\$EXIF:DateTaken[%%Y%%m%%d-%%H%%M%%S]_%%
2) when the original files are .png as EXIF info I have the filename
PNG files don't have EXIF

Re: Rename photos with EXIF

Posted: Tue Nov 02, 2021 8:28 pm
by tomv
hello, many thanks for your response,

I need to scape $_ otherwise don't put the correct name on .png files.
.\NConvert\nconvert -o ..\$EXIF:DateTaken[%%Y%%m%%d-%%H%%M%%S]$_%% -keep_icc -ratio -rtype hanning -rflag decr -resize shortest 1500 -D -overwrite "..\*.png" "..\*.jpg" "..\*.jpeg"

so there is no way to extract the date taken from PNG files?

Re: Rename photos with EXIF

Posted: Thu Nov 04, 2021 2:16 pm
by xnview
tomv wrote: Tue Nov 02, 2021 8:28 pm so there is no way to extract the date taken from PNG files?
So you would like to extract EXIF date if present, else file date?

Re: Rename photos with EXIF

Posted: Fri Nov 05, 2021 7:51 pm
by tomv
Hi, yes, that's right.

Re: Rename photos with EXIF

Posted: Fri Nov 05, 2021 7:57 pm
by tomv
but file date would be the modification date, I guess, not the creation date right?

Re: Rename photos with EXIF

Posted: Tue Nov 09, 2021 1:43 pm
by xnview
Ok, i'll $DateModified

Re: Rename photos with EXIF

Posted: Tue Nov 09, 2021 6:40 pm
by tomv
Fine, many thanks!