Copy tags from one folder to another

Started by Porkey, November 16, 2019, 05:30:13 AM

Previous topic - Next topic

Porkey

Hello, I have a large dataset of .png images which I am trying to convert into .jpg for compression. I have decided on ImageMagick to do the compression, but if EXIFTool is capable of doing the conversion/compression, I would be interested in that route as well.

However, I would like the converted .jpg files to retain as much information as the original .png images. I was pointed here from the ImageMagick forums for this reason.
I am referring mostly to file creation, access, and modify dates.
To my knowledge, .png files do not contain the same tags as .jpg files (such as author, program name, camera info, etc.), but if there is any info NOT shown in the "Details" tab under image properties in Windows, I would like to copy everything I can over to the .jpegs.
I was imagining the process would go something like: convert images -> copy tags from .pngs to .jpgs -> delete original .png files.

Essentially, I just want to make the files smaller, without changing anything else.

Phil Harvey

ExifTool doesn't do any image manipulations.  So it can't do the conversion.

But it can be used to copy the metadata.  Here is the basic command:

exiftool -tagsfromfile %d%f.png -ext jpg DIR

- 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 ($).

StarGeek

Quote from: Porkey on November 16, 2019, 05:30:13 AM
To my knowledge, .png files do not contain the same tags as .jpg files (such as author, program name, camera info, etc.), but if there is any info NOT shown in the "Details" tab under image properties in Windows, I would like to copy everything I can over to the .jpegs.

Windows, really most software, support of metadata in PNG images is pretty much non-existent.  While PNG images can hold metadata such as you list in their own format (see the PNG tag page) as well as EXIF and XMP metadata, I have yet to find a program that will read a reasonable range of such metadata. 

The only thing that Windows will read in PNG files is the PNG:CreationTime tag, which Windows -> Properties -> Details tab displays as "Date Taken".

To expand upon Phil's basic command, to copy the OS system timestamps that you first mention, you would use
exiftool -tagsfromfile %d%f.png -FileCreateDate -FileModifyDate -ext jpg DIR

Note that this assumes the jpegs are in the same directory as the PNGs.  If not, you would replace the %d with the path to the PNG files and DIR would point to the directory with the jpeg files
exiftool -tagsfromfile C:/path/to/pngs/%f.png -FileCreateDate -FileModifyDate -ext jpg c:/path/to/jpegs/

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).