How to proper name .PNG files

Started by luutoo, October 07, 2021, 10:21:27 PM

Previous topic - Next topic

luutoo

For starters I want to mention that I'm newbie and just downloaded this software earlier today. Yesterday I decided to download all pictures I had from icloud, I knew from the start that I would have issues with the dates since unlike android devices it isn't saved to the name. I've noticed that my image viewer (nomacs) is able to display the dates for most (haven't checked all) ".jpg" files. Unlike ANY ".png" file, where the date displayed is from when I downloaded my files.
Viewing the meta data of my png, does indeed list the correct date:
$ exiftool IMG_0048.PNG
ExifTool Version Number         : 11.16
File Name                       : IMG_0048.PNG
Directory                       : .
File Size                       : 1305 kB
File Modification Date/Time     : 2021:10:07 00:06:52+02:00
File Access Date/Time           : 2021:10:07 19:42:52+02:00
File Inode Change Date/Time     : 2021:10:07 19:29:58+02:00
File Permissions                : rw-r--r--
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 750
Image Height                    : 1334
Bit Depth                       : 8
Color Type                      : RGB
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
SRGB Rendering                  : Perceptual
XMP Toolkit                     : XMP Core 5.4.0
Date Created                    : 2017:01:19 21:12:37
User Comment                    : Screenshot
Image Size                      : 750x1334
Megapixels                      : 1.0

This is a relief that the date actually is there. So why would my image viewer (and others) default to displaying the "File Inode Change Date/Time" over the "Date Created"?
After looking a lot in the manual I gave the command "exiftool "-DateCreated>FileInodeNumber" *" a try, and it wasn't writable. I doubt this command I made up is correct. The manual said for writing use "-TAG[+-<]=", I used ">" instead and no "=", not sure which does what tbh this is all new for me. Let's say had this command worked and the date would be displayed correct, I don't think this is the way to do it. I realized this after taking a look at one of my ".jpg" files, where it displays the correct date in my image viewer despite the "inodechangedate" being something else:
$ exiftool IMG_1012*
======== IMG_1012.JPG
ExifTool Version Number         : 11.16
File Name                       : IMG_1012.JPG
Directory                       : .
File Size                       : 2.5 MB
File Modification Date/Time     : 2021:10:07 19:28:15+02:00
File Access Date/Time           : 2021:10:07 19:52:50+02:00
File Inode Change Date/Time     : 2021:10:07 19:28:15+02:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Make                            : Apple
Camera Model Name               : iPhone 6
Modify Date                     : 2017:11:04 16:32:27
Date/Time Original              : 2017:11:04 16:32:27
Create Date                     : 2017:11:04 16:32:27
GPS Time Stamp                  : 16:32:27
Date Created                    : 2017:11:04
Time Created                    : 16:32:27+01:00
Date/Time Created               : 2017:11:04 16:32:27+01:00
GPS Date/Time                   : 2017:11:04 16:32:27Z
Create Date                     : 2017:11:04 16:32:27.993
Date/Time Original              : 2017:11:04 16:32:27.993

So what's going on here? I have 4 of the same tags that the ".png" file has, but 9 additional date tags! 2 Modify dates?
What I'm thinking right now is that 1 of these 9 tags is the one that displays the date (e.g Date/Time Original) and that I have to add it to my ".png" file by adding a new tag and copying the date from "Date Created" to it?
This may not be ideal at all, to make a new tag for all future ".png" files I may have?

One thing that is certain is that I want all my file names to have the date before them. This would be for any file type I may have (jpg, png, cr2, wav, mp4, etc), is "Date Created" the tag to insert? I could just disregard the idea with creating a new tag and have the file name as the only date, but I want to try to learn the way things should be done and get used to this program more, as I think it can be very beneficial. Thanks for reading!

Edit: After another 3h in the manual I figured out a command that did what I wanted with the file naming part (as mentioned above, should I use "Date Created" for other ext?):
$ exiftool -v '-filename<${datecreated}%f.%e' -d %Y%m%d_%H%M%S_ TEST_IMG.PNG
======== TEST_IMG.PNG
Setting new values from TEST_IMG.PNG
'TEST_IMG.PNG' --> '20211003_165608_TEST_IMG.PNG'
    1 image files updated

StarGeek

Quote from: luutoo on October 07, 2021, 10:21:27 PM
This is a relief that the date actually is there. So why would my image viewer (and others) default to displaying the "File Inode Change Date/Time" over the "Date Created"?

Because support for metadata in PNG files is close to non-existent.  There are very few apps which will read PNG metadata.  And PNG images rarely have any metadata in the first place.  The fact that you actually have a time stamp you can use is extremely lucky.

QuoteI doubt this command I made up is correct. The manual said for writing use "-TAG[+-<]=", I used ">" instead and no "=", not sure which does what tbh this is all new for me.

The format of the command is correct; you can use either < or >, just as long as the arrow points to the tag you want to write.  But exiftool cannot write to FileInodeNumber, nor FileInodeChangeDate.  See the "writable" column on the Extra tags page.

The difference between using an equal sign and a greater/less than sign is dependent upon what you are doing.  The equal sign is used to assign a static value to a tag.  For example -Description="Totally awesome description".  The greater/less than sign is a shortcut for the -TagsFromFile option and is used anytime you are copying one tag into another, even if you are adding static text as well.

QuoteSo what's going on here? I have 4 of the same tags that the ".png" file has, but 9 additional date tags! 2 Modify dates?
What I'm thinking right now is that 1 of these 9 tags is the one that displays the date (e.g Date/Time Original) and that I have to add it to my ".png" file by adding a new tag and copying the date from "Date Created" to it?

See FAQ #2 and FAQ #3.  The output you show gives you tag descriptions, not names, so it's much harder to figure out what you want to copy and where to.  Secondly, if you use the command in FAQ #3, you will also see duplicate tags which have the same name and you will see what groups they are in.

Jpegs are also much more mature when it comes to metadata and have much more complete metadata support.

QuoteThis would be for any file type I may have (jpg, png, cr2, wav, mp4, etc), is "Date Created" the tag to insert?

The answer is, it depends.  Different file types have different data groups and different tag names.  EXIF time stamps are common in jpegs, tiffs, and RAW file types (CR2, NEF, ARW, etc).  These are set by the camera that took the image.  If it's been processed by another software, such as using Adobe Bridge to add other metadata, then there may also be IPTC IIM/Legacy and/or XMP (which includes IPTC Core/Ext).  A wav file is going to have RIFF data, possibly ID3 as well.  A video file will have Quicktime data, possibly XMP data if it has been touched by an Adobe program.  And of course, only Adobe programs read XMP data in a video file.  And then there are the subtle differences, like the fact that image time stamps are assumed to be the local time where the image was taken, but video time stamps are supposed to be UTC according to the specs.

Some of these data groups have overlapping (duplicate) names, but sometimes they have different names.  For example, in XMP, you would have the Description tag which details what the image is about.  In IPTC, the corresponding tag is Caption-Abstract.  In EXIF, there is a corresponding tag called ImageDescription but it is rarely used.  And Windows, of course, puts there own tag in EXIF called XPComment.

Metadata standards are a hot mess with a lot of standards trying to cover the same or similar things.  And what program A calls a tag is quite often different than what program B calls the tag.


Quote(as mentioned above, should I use "Date Created" for other ext?):

You will have to check the files, preferably with the command in FAQ #3.

In non-PNG image files, you are more likely to get better results using DateTimeOriginal or possibly CreateDate.  For a video file, you are most likely going to want to use the CreateDate tag, but possibly with the addition of the -api QuickTimeUTC option so as to adjust the time from UTC.  You'll have to test other file types, as I have no idea about wav files or if they even have a standard time stamp tag.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Alan Clifford

QuoteSo what's going on here? I have 4 of the same tags that the ".png" file has, but 9 additional date tags! 2 Modify dates?

My default command for looking at files is:

exiftool -a -G  IMG_0048.PNG IMG_1012.JPG

which shows which tags are exif, xmp etc or information from the file system.