Discussions on NConvert - the command line tool for image conversion and manipulation
Moderators: XnTriq , helmut , xnview
Mambobuzzz
Posts: 1 Joined: Wed Apr 07, 2021 2:45 pm
Post
by Mambobuzzz » Wed Apr 07, 2021 2:48 pm
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
xnview
Author of XnView
Posts: 45500 Joined: Mon Oct 13, 2003 7:31 am
Location: France
Post
by xnview » Thu Apr 08, 2021 7:33 am
%F is not recognize on Windows, please use $EXIF[%Y-%m-%d]
Pierre.
tomv
Posts: 21 Joined: Sat Oct 30, 2021 4:33 pm
Post
by tomv » Sat Oct 30, 2021 4:49 pm
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
tomv
Posts: 21 Joined: Sat Oct 30, 2021 4:33 pm
Post
by tomv » Sat Oct 30, 2021 5:27 pm
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)
xnview
Author of XnView
Posts: 45500 Joined: Mon Oct 13, 2003 7:31 am
Location: France
Post
by xnview » Tue Nov 02, 2021 9:34 am
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
Pierre.
tomv
Posts: 21 Joined: Sat Oct 30, 2021 4:33 pm
Post
by tomv » Tue Nov 02, 2021 8:28 pm
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?
xnview
Author of XnView
Posts: 45500 Joined: Mon Oct 13, 2003 7:31 am
Location: France
Post
by xnview » Thu Nov 04, 2021 2:16 pm
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?
Pierre.
tomv
Posts: 21 Joined: Sat Oct 30, 2021 4:33 pm
Post
by tomv » Fri Nov 05, 2021 7:51 pm
Hi, yes, that's right.
tomv
Posts: 21 Joined: Sat Oct 30, 2021 4:33 pm
Post
by tomv » Fri Nov 05, 2021 7:57 pm
but file date would be the modification date, I guess, not the creation date right?
xnview
Author of XnView
Posts: 45500 Joined: Mon Oct 13, 2003 7:31 am
Location: France
Post
by xnview » Tue Nov 09, 2021 1:43 pm
Ok, i'll $DateModified
Pierre.
tomv
Posts: 21 Joined: Sat Oct 30, 2021 4:33 pm
Post
by tomv » Tue Nov 09, 2021 6:40 pm
Fine, many thanks!