How to rename sidecard files as well?

Started by SampsonF, June 08, 2021, 10:51:41 PM

Previous topic - Next topic

SampsonF


EXIFCMD="filename"
EXIFDIR="/var/vols/Pics"
exiftool -d %Y/week%W/%A \
   -$EXIFCMD'<${FileModifyDate}/%f%-c.%le' \
   -r "$EXIFDIR"


After running the above command, I notice a lot of AAE files are untouched.

Reading the forum, I learnt that those AAE files are called sidecard files.  How can I adjust the above exiftool to handle sidecard files as well?

Phil Harvey

> exiftool -listwf
Writable file extensions:
  360 3G2 3GP 3GP2 3GPP AAX AI AIT APNG ARQ ARW AVIF CIFF CR2 CR3 CRM CRW CS1
  DCP DNG DR4 DVB EPS EPS2 EPS3 EPSF ERF EXIF EXV F4A F4B F4P F4V FFF FLIF GIF
  GPR HDP HEIC HEIF HIF ICC ICM IIQ IND INDD INDT INSP J2K JNG JP2 JPE JPEG JPF
  JPG JPM JPS JPX JXL JXR LRV M4A M4B M4P M4V MEF MIE MNG MOS MOV MP4 MPO MQV
  MRW NEF NRW ORF ORI PBM PDF PEF PGM PNG PPM PS PS2 PS3 PSB PSD PSDT QT RAF
  RAW RW2 RWL SR2 SRW THM TIF TIFF TTT VRD WDP X3F XMP


AAE is not a writable file type (see the the command above), so this is FAQ 16.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

SampsonF

#2
I find this topic:
https://exiftool.org/forum/index.php?topic=9423.msg48747#msg48747

After studying, I tried using this command:


EXIFCMD="testname"
EXIFDIR="."
exiftool -v -ext aae -d %YWeek%W \
\
   -tagsfromfile %d%f.png \
   -$EXIFCMD'<${FileModifyDate}/%f%-c.%le' \
   -$EXIFCMD'<${FileModifyDate}${IPTCDigest;$_=""}/Whatsapp/Whatsapp-%f%-c.%le' \
   -$EXIFCMD'<${createdate}/%f%-c.%le' \
   -$EXIFCMD'<${createdate}/${make;}${model;}/%f%-c.%le' \
   -$EXIFCMD'<${datetimeoriginal}/${make;}_${model;}/%f%-c.%le' \
\
   -tagsfromfile %d%f.jpg \
   -$EXIFCMD'<${FileModifyDate}/%f%-c.%le' \
   -$EXIFCMD'<${FileModifyDate}${IPTCDigest;$_=""}/Whatsapp/Whatsapp-%f%-c.%le' \
   -$EXIFCMD'<${createdate}/%f%-c.%le' \
   -$EXIFCMD'<${createdate}/${make;}${model;}/%f%-c.%le' \
   -$EXIFCMD'<${datetimeoriginal}/${make;}_${model;}/%f%-c.%le' \
\
   -tagsfromfile %d%f.mov \
   -$EXIFCMD'<${FileModifyDate}/%f%-c.%le' \
   -$EXIFCMD'<${FileModifyDate}${IPTCDigest;$_=""}/Whatsapp/Whatsapp-%f%-c.%le' \
   -$EXIFCMD'<${createdate}/%f%-c.%le' \
   -$EXIFCMD'<${createdate}/${make;}${model;}/%f%-c.%le' \
   -$EXIFCMD'<${datetimeoriginal}/${make;}_${model;}/%f%-c.%le' \
\
-r "$EXIFDIR"


I got this result:

======== ./Apple_iPhone 6s Plus/IMG_2281.AAE
Setting new values from ./Apple_iPhone 6s Plus/IMG_2281.png
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_2281.png
Setting new values from ./Apple_iPhone 6s Plus/IMG_2281.jpg
Warning: [minor] Tag 'IPTCDigest' not defined - ./Apple_iPhone 6s Plus/IMG_2281.jpg
Setting new values from ./Apple_iPhone 6s Plus/IMG_2281.mov
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_2281.mov
'./Apple_iPhone 6s Plus/IMG_2281.AAE' --> '2019Week49/Apple_iPhone 6s Plus/IMG_2281.aae'
======== ./Apple_iPhone 6s Plus/IMG_2258.AAE
Setting new values from ./Apple_iPhone 6s Plus/IMG_2258.png
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_2258.png
Setting new values from ./Apple_iPhone 6s Plus/IMG_2258.jpg
Warning: [minor] Tag 'IPTCDigest' not defined - ./Apple_iPhone 6s Plus/IMG_2258.jpg
Setting new values from ./Apple_iPhone 6s Plus/IMG_2258.mov
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_2258.mov
'./Apple_iPhone 6s Plus/IMG_2258.AAE' --> '2019Week49/Apple_iPhone 6s Plus/IMG_2258.aae'
======== ./Apple_iPhone 6s Plus/IMG_2256.AAE
Setting new values from ./Apple_iPhone 6s Plus/IMG_2256.png
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_2256.png
Setting new values from ./Apple_iPhone 6s Plus/IMG_2256.jpg
Warning: [minor] Tag 'IPTCDigest' not defined - ./Apple_iPhone 6s Plus/IMG_2256.jpg
Setting new values from ./Apple_iPhone 6s Plus/IMG_2256.mov
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_2256.mov
'./Apple_iPhone 6s Plus/IMG_2256.AAE' --> '2019Week49/Apple_iPhone 6s Plus/IMG_2256.aae'
======== ./Apple_iPhone 6s Plus/IMG_2151.AAE
Setting new values from ./Apple_iPhone 6s Plus/IMG_2151.png
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_2151.png
Setting new values from ./Apple_iPhone 6s Plus/IMG_2151.jpg
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_2151.jpg
Setting new values from ./Apple_iPhone 6s Plus/IMG_2151.mov
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_2151.mov
Nothing changed in ./Apple_iPhone 6s Plus/IMG_2151.AAE
======== ./Apple_iPhone 6s Plus/IMG_1515.AAE
Setting new values from ./Apple_iPhone 6s Plus/IMG_1515.png
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_1515.png
Setting new values from ./Apple_iPhone 6s Plus/IMG_1515.jpg
Warning: [minor] Tag 'IPTCDigest' not defined - ./Apple_iPhone 6s Plus/IMG_1515.jpg
Setting new values from ./Apple_iPhone 6s Plus/IMG_1515.mov
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_1515.mov
'./Apple_iPhone 6s Plus/IMG_1515.AAE' --> '2019Week49/Apple_iPhone 6s Plus/IMG_1515.aae'
======== ./Apple_iPhone 6s Plus/IMG_1930.AAE
Setting new values from ./Apple_iPhone 6s Plus/IMG_1930.png
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_1930.png
Setting new values from ./Apple_iPhone 6s Plus/IMG_1930.jpg
Warning: [minor] Tag 'IPTCDigest' not defined - ./Apple_iPhone 6s Plus/IMG_1930.jpg
Setting new values from ./Apple_iPhone 6s Plus/IMG_1930.mov
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_1930.mov
'./Apple_iPhone 6s Plus/IMG_1930.AAE' --> '2019Week49/Apple_iPhone 6s Plus/IMG_1930.aae'
======== ./Apple_iPhone 6s Plus/IMG_1918.AAE
Setting new values from ./Apple_iPhone 6s Plus/IMG_1918.png
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_1918.png
Setting new values from ./Apple_iPhone 6s Plus/IMG_1918.jpg
Warning: [minor] Tag 'IPTCDigest' not defined - ./Apple_iPhone 6s Plus/IMG_1918.jpg
Setting new values from ./Apple_iPhone 6s Plus/IMG_1918.mov
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_1918.mov
'./Apple_iPhone 6s Plus/IMG_1918.AAE' --> '2019Week49/Apple_iPhone 6s Plus/IMG_1918.aae'
======== ./Apple_iPhone 6s Plus/IMG_1557.AAE
Setting new values from ./Apple_iPhone 6s Plus/IMG_1557.png
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_1557.png
Setting new values from ./Apple_iPhone 6s Plus/IMG_1557.jpg
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_1557.jpg
Setting new values from ./Apple_iPhone 6s Plus/IMG_1557.mov
Warning: Error opening file - ./Apple_iPhone 6s Plus/IMG_1557.mov
Nothing changed in ./Apple_iPhone 6s Plus/IMG_1557.AAE
======== ./Whatsapp/Whatsapp-IMG_2118.AAE
Setting new values from ./Whatsapp/Whatsapp-IMG_2118.png
Warning: Error opening file - ./Whatsapp/Whatsapp-IMG_2118.png
Setting new values from ./Whatsapp/Whatsapp-IMG_2118.jpg
Warning: [minor] Tag 'createdate' not defined - ./Whatsapp/Whatsapp-IMG_2118.jpg
Setting new values from ./Whatsapp/Whatsapp-IMG_2118.mov
Warning: Error opening file - ./Whatsapp/Whatsapp-IMG_2118.mov
'./Whatsapp/Whatsapp-IMG_2118.AAE' --> '2019Week49/Whatsapp/Whatsapp-Whatsapp-IMG_2118.aae'
======== ./Whatsapp/Whatsapp-IMG_1556.AAE
Setting new values from ./Whatsapp/Whatsapp-IMG_1556.png
Warning: Error opening file - ./Whatsapp/Whatsapp-IMG_1556.png
Setting new values from ./Whatsapp/Whatsapp-IMG_1556.jpg
Warning: [minor] Tag 'createdate' not defined - ./Whatsapp/Whatsapp-IMG_1556.jpg
Setting new values from ./Whatsapp/Whatsapp-IMG_1556.mov
Warning: Error opening file - ./Whatsapp/Whatsapp-IMG_1556.mov
'./Whatsapp/Whatsapp-IMG_1556.AAE' --> '2019Week49/Whatsapp/Whatsapp-Whatsapp-IMG_1556.aae'
======== ./IMG_2372.AAE
Setting new values from ./IMG_2372.png
Warning: [minor] Tag 'IPTCDigest' not defined - ./IMG_2372.png
Setting new values from ./IMG_2372.jpg
Warning: Error opening file - ./IMG_2372.jpg
Setting new values from ./IMG_2372.mov
Warning: Error opening file - ./IMG_2372.mov
'./IMG_2372.AAE' --> '2019Week49/IMG_2372.aae'
======== ./IMG_2150.AAE
Setting new values from ./IMG_2150.png
Warning: [minor] Tag 'IPTCDigest' not defined - ./IMG_2150.png
Setting new values from ./IMG_2150.jpg
Warning: Error opening file - ./IMG_2150.jpg
Setting new values from ./IMG_2150.mov
Warning: Error opening file - ./IMG_2150.mov
'./IMG_2150.AAE' --> '2019Week49/IMG_2150.aae'
======== ./IMG_2031.AAE
Setting new values from ./IMG_2031.png
Warning: [minor] Tag 'IPTCDigest' not defined - ./IMG_2031.png
Setting new values from ./IMG_2031.jpg
Warning: Error opening file - ./IMG_2031.jpg
Setting new values from ./IMG_2031.mov
Warning: Error opening file - ./IMG_2031.mov
'./IMG_2031.AAE' --> '2019Week49/IMG_2031.aae'
======== ./IMG_2030.AAE
Setting new values from ./IMG_2030.png
Warning: [minor] Tag 'IPTCDigest' not defined - ./IMG_2030.png
Setting new values from ./IMG_2030.jpg
Warning: Error opening file - ./IMG_2030.jpg
Setting new values from ./IMG_2030.mov
Warning: Error opening file - ./IMG_2030.mov
'./IMG_2030.AAE' --> '2019Week49/IMG_2030.aae'
======== ./IMG_1943.AAE
Setting new values from ./IMG_1943.png
Warning: [minor] Tag 'IPTCDigest' not defined - ./IMG_1943.png
Setting new values from ./IMG_1943.jpg
Warning: Error opening file - ./IMG_1943.jpg
Setting new values from ./IMG_1943.mov
Warning: Error opening file - ./IMG_1943.mov
'./IMG_1943.AAE' --> '2019Week49/IMG_1943.aae'
======== ./IMG_1942.AAE
Setting new values from ./IMG_1942.png
Warning: [minor] Tag 'IPTCDigest' not defined - ./IMG_1942.png
Setting new values from ./IMG_1942.jpg
Warning: Error opening file - ./IMG_1942.jpg
Setting new values from ./IMG_1942.mov
Warning: Error opening file - ./IMG_1942.mov
'./IMG_1942.AAE' --> '2019Week49/IMG_1942.aae'
======== ./IMG_1941.AAE
Setting new values from ./IMG_1941.png
Warning: [minor] Tag 'IPTCDigest' not defined - ./IMG_1941.png
Setting new values from ./IMG_1941.jpg
Warning: Error opening file - ./IMG_1941.jpg
Setting new values from ./IMG_1941.mov
Warning: Error opening file - ./IMG_1941.mov
'./IMG_1941.AAE' --> '2019Week49/IMG_1941.aae'
======== ./IMG_1938.AAE
Setting new values from ./IMG_1938.png
Warning: [minor] Tag 'IPTCDigest' not defined - ./IMG_1938.png
Setting new values from ./IMG_1938.jpg
Warning: Error opening file - ./IMG_1938.jpg
Setting new values from ./IMG_1938.mov
Warning: Error opening file - ./IMG_1938.mov
'./IMG_1938.AAE' --> '2019Week49/IMG_1938.aae'
======== ./IMG_1552.AAE
Setting new values from ./IMG_1552.png
Warning: [minor] Tag 'IPTCDigest' not defined - ./IMG_1552.png
Setting new values from ./IMG_1552.jpg
Warning: Error opening file - ./IMG_1552.jpg
Setting new values from ./IMG_1552.mov
Warning: Error opening file - ./IMG_1552.mov
'./IMG_1552.AAE' --> '2019Week49/IMG_1552.aae'
======== ./IMG_1535.AAE
Setting new values from ./IMG_1535.png
Warning: [minor] Tag 'IPTCDigest' not defined - ./IMG_1535.png
Setting new values from ./IMG_1535.jpg
Warning: Error opening file - ./IMG_1535.jpg
Setting new values from ./IMG_1535.mov
Warning: Error opening file - ./IMG_1535.mov
'./IMG_1535.AAE' --> '2019Week49/IMG_1535.aae'
    3 directories scanned
    0 image files updated
   20 image files unchanged


It seems those AAE files got renamed.

My next question is:  how to rename those AAE  and the media files (png, mov, jpg, mp4, etc) in one pass ?

And, how can the above command be simplified?

SampsonF

#3
I have find this also:
https://exiftool.org/forum/index.php?topic=10824.msg57887#msg57887

So I am testing with this command now:


EXIFCMD="testname"
EXIFDIR="."
exiftool -fileorder filename -ext+ aae -v -d %YWeek%W \
\
   -tagsfromfile %d%f.png \
   -$EXIFCMD'<${FileModifyDate}/%f%-c.%le' \
   -$EXIFCMD'<${FileModifyDate}${IPTCDigest;$_=""}/Whatsapp/Whatsapp-%f%-c.%le' \
   -$EXIFCMD'<${createdate}/%f%-c.%le' \
   -$EXIFCMD'<${createdate}/${make;}${model;}/%f%-c.%le' \
   -$EXIFCMD'<${datetimeoriginal}/${make;}_${model;}/%f%-c.%le' \
\
   -tagsfromfile %d%f.jpg \
   -$EXIFCMD'<${FileModifyDate}/%f%-c.%le' \
   -$EXIFCMD'<${FileModifyDate}${IPTCDigest;$_=""}/Whatsapp/Whatsapp-%f%-c.%le' \
   -$EXIFCMD'<${createdate}/%f%-c.%le' \
   -$EXIFCMD'<${createdate}/${make;}${model;}/%f%-c.%le' \
   -$EXIFCMD'<${datetimeoriginal}/${make;}_${model;}/%f%-c.%le' \
\
   -tagsfromfile %d%f.mov \
   -$EXIFCMD'<${FileModifyDate}/%f%-c.%le' \
   -$EXIFCMD'<${FileModifyDate}${IPTCDigest;$_=""}/Whatsapp/Whatsapp-%f%-c.%le' \
   -$EXIFCMD'<${createdate}/%f%-c.%le' \
   -$EXIFCMD'<${createdate}/${make;}${model;}/%f%-c.%le' \
   -$EXIFCMD'<${datetimeoriginal}/${make;}_${model;}/%f%-c.%le' \
\
-r "$EXIFDIR"