mass changing EXIF of jpg

English support forum

Moderators: white, Hacker, petermad, Stefan2

Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: mass changing EXIF of jpg

Post by *Fla$her »

solid wrote: ↑2023-02-02, 10:45 UTC No, I didn't provide a screenshot, but I did provide a way how to check it by yourself.
Firstly, you should not over-quote, this is a bad tone. And without providing what was requested, I believe you lost this dispute, no offense.
solid wrote: ↑2023-02-02, 10:45 UTCBut, even better, you provided screenshots that shows what I'm talking about. In your screenshots can be clearly seen that IV and XN show different names for same EXIF tags.
Work hard to read my answer to petermad, where I gave an explanation about this misconception.
P. S: I provided the screenshots to prove once again that the meta tags are not mirrored and may have different values.
Overquoting is evil! πŸ‘Ž
chiara.codagnone
Junior Member
Junior Member
Posts: 12
Joined: 2023-01-29, 03:38 UTC

Re: mass changing EXIF of jpg

Post by *chiara.codagnone »

Thanks for all your answer.

About fields names:
I know that probably the ones I have been using aren't the correct fields names, but i'm translating them from italian.
If you ignore Date of Creation, Date Modified and Date last Open, there is only one field remaining which says the "real date of acquisition of this media". Or at least just one field which is usually filled by phone cameras. Which is named differently for .png, .jpg, .mp4.

In this post i will call "Date Acquired" for .jpg attribute of "the day the photo was taken"
and Date Media Created for .mp4 attribute of "the day the video was taken", even if they probably have different names in english.

About main topic:
I could modify all the .jpg attributes by doing > Change Attributes > jpg-comment.DateTimeOriginal -> [=tc.name5-8]/[=tc.name3-4]/{=tc.name1-2]

I still didn't find any plugins which make you change .mp4, .png, .m4v date attributes (Date Media Created).
The only plugin which works with "Change Attributes" tc function is JPG-comment, which fields refer just to .jpg

I have other plugins such as shelldetails for multi rename tool, but still can't find one which you can use in "Change attributes" function for .mp4.

I have another question related: MOVED TO A NEW POST: https://ghisler.ch/board/viewtopic.php?p=426822#p426822
I'm using personalized columns for photos and videos.
I wanted to add a column with date acquired for jpg, and Date media created for videos.

So i'm wondering if it possible to write a column rule like " If file extension is jpg, show [=shelldetails.dateacquired] else if file extension is mp4 show [=shelldetails.datemediacreated]


Actually the best solution I have found is: [=shelldetails.DateMediaCreated][=shelldetails.DateAcquired]
Since a media file can't have both fields at the same time, my column works properly, showing me the first field for .mp4 and the second field for .jpg

The problem is that sorting files by date with this kind of column:
it sorts just .mp4 files if i put .mp4 field before [=shelldetails.DateMediaCreated][=shelldetails.DateAcquired]
or it sorts just .jpg files if i put jpg field before [=shelldetails.DateAcquired][=shelldetails.DateMediaCreated]

How can i fix it?


Part 2: [SOLVED]

I wanted to aswell add a column with resolution which is a different field for videos or photo.
With photos i have a field which put resolution already as a string axb called shelldetails.dimension which is exactly what i wanted,
Otherwise for videos there are only 2 fields which natural numbers of x dimension and y dimension

As I did with the personalized column of date, i put:

[=shelldetails.Dimension][=shelldetails.xDimension] [=shelldetails.yDimension]
Which show me just the first string [Dimension] for photos
and the other strings [xDimension][yDimension] for videos

The problem is: if i set the column like this ([=shelldetails.Dimension][=shelldetails.xDimension] [=shelldetails.yDimension]) i'll have:
Name Resolution
file1.jpg 1920x1080
file2.jpg 1920x1080
file3.mp4 1920 1080
file4.mp4 1920 1080

if i set the column like this ([=shelldetails.Dimension][=shelldetails.xDimension]x[=shelldetails.yDimension]) i'll have:
Name Resolution
file1.jpg 1920x1080x
file2.jpg 1920x1080x
file3.mp4 1920x1080
file4.mp4 1920x1080

Is there a way to fix it?
As before, in less words, I want to have column rules which show me different things for different file extensions.
Last edited by chiara.codagnone on 2023-02-05, 16:00 UTC, edited 17 times in total.
User avatar
sqa_wizard
Power Member
Power Member
Posts: 3854
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: mass changing EXIF of jpg

Post by *sqa_wizard »

Try
[=shelldetails.Dimension][=shelldetails.xDimension] [="x"shelldetails.yDimension]

This way the "x" as prefix will only appear if yDimension is available :idea:

EDIT: the "x" as a prefix must be right after the "="
Last edited by sqa_wizard on 2023-02-05, 17:33 UTC, edited 1 time in total.
#5767 Personal license
chiara.codagnone
Junior Member
Junior Member
Posts: 12
Joined: 2023-01-29, 03:38 UTC

Re: mass changing EXIF of jpg

Post by *chiara.codagnone »

sqa_wizard wrote: ↑2023-02-04, 19:28 UTC Try
[=shelldetails.Dimension][=shelldetails.xDimension] ["x"=shelldetails.yDimension]

This way the "x" as prefix will only appear if yDimension is available :idea:
Just tried
[=shelldetails.Dimension][=shelldetails.xDim]["x"=shelldetails.yDim]
and the output of resolution for .mp4 is 19201440

[Edit]
Ok, I got that it works if:
[=shelldetails.Dimension][=shelldetails.xDim"x"][=shelldetails.yDim]
output: 1920x1440
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: mass changing EXIF of jpg

Post by *Fla$her »

chiara.codagnone wrote: ↑2023-02-04, 18:39 UTC I know that probably the ones I have been using aren't the correct fields names, but i'm translating them from italian.
And how will Date Taken be in Italian? Data originale? No? :)
chiara.codagnone wrote: ↑2023-02-04, 18:39 UTC About main topic:
...
I still didn't find any plugins which make you change .mp4, .png, .m4v date attributes (Date Media Created).
How can this be the main topic if the title is about jpg?
With regards to mp4, I gave you a link to the relevant topic. There ask about this type if something is unclear.
And in general, there are no more than a dozen plugins that can edit something, so it's useless to look for something other than utilities here.
Overquoting is evil! πŸ‘Ž
chiara.codagnone
Junior Member
Junior Member
Posts: 12
Joined: 2023-01-29, 03:38 UTC

Re: mass changing EXIF of jpg

Post by *chiara.codagnone »

Image: https://i.postimg.cc/02cYwXzP/Immagine.png

2Fla$her
In italian is Data di Acquisizione for jpg and for png. and Elemento multimediale creato for mp4. That's why i translated like that.
Last edited by chiara.codagnone on 2023-02-04, 21:29 UTC, edited 2 times in total.
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: mass changing EXIF of jpg

Post by *Fla$her »

2chiara.codagnone
Thanks for the reply. And tell me in which graphics program I can see "Data di Acquisizione" as "Date Taken"?
Unfortunately, your screenshot is not enough for me to check it myself.
Overquoting is evil! πŸ‘Ž
chiara.codagnone
Junior Member
Junior Member
Posts: 12
Joined: 2023-01-29, 03:38 UTC

Re: mass changing EXIF of jpg

Post by *chiara.codagnone »

Fla$her wrote: ↑2023-02-04, 21:26 UTC Thanks for the reply. And tell me in which graphics program I can see "Data di Acquisizione" as "Date Taken"?
Unfortunately, your screenshot is not enough for me to check it myself.
I can send you a rar file with three files, an mp4, jpg, and png with different "data di acquisizione" and "date of creation" and you can check the fields if it is what you were asking for (i probably didn't get your request).

https://drive.google.com/file/d/1mXrDhGJrW3M8akkHUjNIx2rf3JXzO7Z6/view?usp=share_link

Here you can download it. The field I call "Data di acquisizione" for png and jpg and "Elemento Multimediale Creato" for mp4 is the one set on "20/10/2005" in these 3 files when you go to proprieties->details
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: mass changing EXIF of jpg

Post by *Fla$her »

2chiara.codagnone
I asked for a program, not files. However, in the case of png and mp4, they turned out to be useful. The solution with exiftool, which Gral offered, is as follows:

For jpg/jpeg:

Code: Select all

exiftool "-DateTimeOriginal<${FileName;s/^(\d{4})(\d{2})(\d{2}).+/\1:\2:\3 0:0:0/}" -ext jpg -ext jpeg -q -r .
For png:

Code: Select all

exiftool "-CreationTime<${FileName;s/^(\d{4})(\d{2})(\d{2}).+/\1:\2:\3/}" -ext png -q -r .
For mp4:

Code: Select all

exiftool "-CreateDate<${FileName;s/^(\d{4})(\d{2})(\d{2}).+/\1:\2:\3/}" -ext mp4 -q -r .
When creating a button, specify the full path to the utility and leave the "Start path:" field empty. Thus, the tags for all relevant files (yyyyMMdd.ext) will be changed in the folder structure of the active panel.
Overquoting is evil! πŸ‘Ž
chiara.codagnone
Junior Member
Junior Member
Posts: 12
Joined: 2023-01-29, 03:38 UTC

Re: mass changing EXIF of jpg

Post by *chiara.codagnone »

Fla$her wrote: ↑2023-02-05, 21:02 UTC 2chiara.codagnone
I asked for a program, not files. However, in the case of png and mp4, they turned out to be useful. The solution with exiftool, which Gral offered, is as follows:

For jpg/jpeg:

Code: Select all

exiftool "-DateTimeOriginal<${FileName;s/^(\d{4})(\d{2})(\d{2}).+/\1:\2:\3 0:0:0/}" -ext jpg -ext jpeg -q -r .
For png:

Code: Select all

exiftool "-CreationTime<${FileName;s/^(\d{4})(\d{2})(\d{2}).+/\1:\2:\3/}" -ext png -q -r .
For mp4:

Code: Select all

exiftool "-CreateDate<${FileName;s/^(\d{4})(\d{2})(\d{2}).+/\1:\2:\3/}" -ext mp4 -q -r .
When creating a button, specify the full path to the utility and leave the "Start path:" field empty. Thus, the tags for all relevant files (yyyyMMdd.ext) will be changed in the folder structure of the active panel.
Thanks for your help. Could you tell me how to create this button? Sorry, as I said i'm new in tc :)
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: mass changing EXIF of jpg

Post by *Fla$her »

2chiara.codagnone
You are welcome. This is the simplest: 1, 2.
The same is done with exiftool.exe and parameters.
Overquoting is evil! πŸ‘Ž
chiara.codagnone
Junior Member
Junior Member
Posts: 12
Joined: 2023-01-29, 03:38 UTC

Re: mass changing EXIF of jpg

Post by *chiara.codagnone »

Fla$her wrote: ↑2023-02-06, 00:32 UTC 2chiara.codagnone
You are welcome. This is the simplest: 1, 2.
The same is done with exiftool.exe and parameters.
Hi! it works fine with png but not with mp4 :)

[EDIT]
it works if i put : here:
"-CreateDate<${FileName;s/^(\d{4}):(\d{2}):(\d{2}).+/\1:\2:\3/}" -ext mp4 -q -r .
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: mass changing EXIF of jpg

Post by *Fla$her »

chiara.codagnone wrote: ↑2023-02-06, 01:54 UTC but not with mp4 :)
Strange. It works for me with your file.
chiara.codagnone wrote: ↑2023-02-06, 01:54 UTC it works if i put : here:
"-CreateDate<${FileName;s/^(\d{4}):(\d{2}):(\d{2}).+/\1:\2:\3/}" -ext mp4 -q -r .
Then it's made easier:

Code: Select all

exiftool -CreateDate"<"Basename -ext mp4 -q -r .
Overquoting is evil! πŸ‘Ž
chiara.codagnone
Junior Member
Junior Member
Posts: 12
Joined: 2023-01-29, 03:38 UTC

Re: mass changing EXIF of jpg

Post by *chiara.codagnone »

Also, it works with half of mp4 files, for the other half I get this in cmd window

Code: Select all

Warning: Truncated 'F\x96\x197' data - ./20210601 1.mp4
Error: Truncated 'F\x96\x197' atom - ./20210601 1.mp4
Warning: Truncated '\xb4\xb4\xb4\xb4' data - ./20210602 2.mp4
Error: Truncated '0xb4b4b4b4' atom - ./20210602 2.mp4
Warning: Truncated '\xa0\xfe\xa2\x96' data - ./20210607 3.mp4
Error: Truncated '0xa0fea296' atom - ./20210607 3.mp4
Warning: Truncated '\x00\x00\x00\x1d' data - ./20210610 4.mp4
Error: [minor] Possible garbage at end of file (99 bytes) - ./20210610 4.mp4
Warning: Truncated 'L\xb0\xc6b' data - ./20210610 5.mp4
Error: Truncated 'L\xb0\xc6b' atom - ./20210610 5.mp4
Warning: Truncated '\x04\x00\x00\x00' data - ./20210615 6.mp4
Error: Truncated '0x04000000' atom - ./20210615 6.mp4
Warning: Truncated '\x03\x00\x00\x00' data - ./20210615 7.mp4
Error: Truncated '0x03000000' atom - ./20210615 7.mp4
Warning: Truncated 'ZZZZ' data - ./20210620 8.mp4
Error: Truncated 'ZZZZ' atom - ./20210620 8.mp4
Warning: Truncated 'ZZZZ' data - ./20210624 9.mp4
Error: Truncated 'ZZZZ' atom - ./20210624 9.mp4
Warning: Truncated '\xbc\x80B\x96' data - ./20210625 10.mp4
Error: Truncated '0xbc804296' atom - ./20210625 10.mp4
Warning: Truncated '\x02\x13\x00\x00' data - ./20210625 11.mp4
Error: Truncated '0x02130000' atom - ./20210625 11.mp4
Warning: Truncated '\x00\x01\x00\x00' data - ./20210625 12.mp4
Error: Truncated '0x00010000' atom - ./20210625 12.mp4
Warning: Truncated 'ZZZZ' data - ./20210626 13.mp4
Error: Truncated 'ZZZZ' atom - ./20210626 13.mp4
Warning: Truncated '\x9a\xa7q\xe5' data - ./20210630 15.mp4
It is also courious since he seems to change dates to more files the more i start the process. After 15 launches on a 200 files folder, he changed everything except for 50 mp4 files
(i want to specify those files are openable and not corrupted)
Last edited by chiara.codagnone on 2023-02-07, 00:00 UTC, edited 1 time in total.
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: mass changing EXIF of jpg

Post by *Fla$her »

2chiara.codagnone
You didn't write that there can be a counter at the end of names. Then it's done thus:

Code: Select all

exiftool "-CreateDate<${Basename;s/^(\d{8}).*/\1/}" -ext mp4 -q -r .
P. S.: Do not quote the posts in their entirety, please.
Overquoting is evil! πŸ‘Ž
Post Reply