Exiftool reduces the resolution of jpgs

Started by Scriptero, April 23, 2020, 08:25:39 PM

Previous topic - Next topic

Scriptero

Btw i am using photoshop jpgs and pngs.
I used photoshop to check the files resolution. I'm using a mac terminal. My script, again, is: exiftool -r -all -ext jpg -ext png destination. I I don't know what other detail I'm missing, oh yeah, I am frustrated...?

Phil Harvey

Quote from: Scriptero on April 25, 2020, 07:38:32 PM
My assumption, like you say, is that it will remove all the metadata without altering the files resolution. The resolution of the "clean" files where 72dpi!!! To make this conversation shorter, try for yourself and post back your results. Thanks

Yes.  I got this.  And as we said, using -all= will delete the resolution metadata.  But this doesn't affect the image.  And it doesn't set the resolution to 72 dpi either.  Whatever software you are using is assuming 72 dpi as the default resolution for an image with no resolution tags.  Just add these tags back as we showed you and all will be good.

This isn't a big deal.  The resolution tags are essentially meaningless anyway, for the reason I mentioned.

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

Alan Clifford

When you see the resolution tag, you are just seeing a piece of text.  It has nothing to do with the size, quality, whatever of the actual image.

Scriptero

Can i do it all in one line?
Remove the keywords and retain the res tags. I apologize for my denseness.

Phil Harvey

Yes.  StarGeek provided that command for you.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Scriptero

Quote from: StarGeek on April 24, 2020, 01:17:50 AM
You can copy the resolution tags back into the file after the -all=.

exiftool -r -all= -TagsFromFile @ -*resolution* -ext jpg -ext pdf -ext ai -ext png -ext tif -ext psd -overwrite_original /path/to/files/

Stargeek,

I tried the script the way it is written, I cut n pasted into terminal but I got the same results. Is the syntax correct?
I'm wondering if I have an extra space or one too many wildcards? I looked at both original and after exiftool and again the clean file reads 72dpi in photoshop.

Phil Harvey

What is the output of this command on a file before and after you ran StarGeek's command?:

exiftool -*resolution* -G1 -a FILE

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

Scriptero

Nope. 72.
Keep in mind, I am looking at info size in photoshop. After exiftool magic i get 72... :(

StarGeek

Please run the command Phil asked and post the output here.  We can't figure out what the problem might be without it.
* 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).

Scriptero

As I explained earlier, I ran the exiftool command on my terminal on my mac running os sierra 10.12.6
"exiftool -r -all= -TagsFromFile @ -*resolution* -ext png --overwrite_original Test folder" I have a test folder with 3 .png files which are 300dpi at different pixel sizes.
After running that script, the results are that all 3 files get scanned and updated.
I checked the files in the info field in Photoshop and it reads 72dpi and the pixel size for ALL are 645x153.
Not only that the file dimensions are also changed.
Contrary to the statements here in this forum, the issue is that the "-all" DOES alter not only the dimensions of the file but the resolution as well.

I'm surprised that something soooo basic has not been addressed before.
Could someone do what I just did and come up with a practical solution instead of offering useless suggestions, like Phil's comment: "...And as we said, using -all= will delete the resolution metadata.  But this doesn't affect the image.  And it doesn't set the resolution to 72 dpi either.
Well...I just did and i challenge anyone in this forum.
Create a .png file at specific size above 72 dpi. Run the exiftool with the -all tag and you WILL discover that the file size and resolution has changed. This is getting too frustrating for me...

StarGeek

Quote from: Scriptero on April 28, 2020, 12:02:30 PM
As I explained earlier, I ran the exiftool command on my terminal on my mac running os sierra 10.12.6

We understand that.  But Phil just asked you a couple posts above this one to run a different command and post the results so that we can see where the problem might be.  You did not do so.

QuoteContrary to the statements here in this forum, the issue is that the "-all" DOES alter not only the dimensions of the file but the resolution as well.

It does not alter the dimensions of the image.  Open up the file in an image viewer.  Look at the image dimensions in finder

Look at the pixel dimensions in PS

You will see that the image size is the same. You will see that they have not changed.

QuoteCould someone do what I just did and come up with a practical solution instead of offering useless suggestions

We are trying but you are not cooperating when we ask you to run a command so we can see what data needs to be copied.

Read about the The 72 PPI Web Resolution Myth to understand the situation better.
* 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).

Scriptero

I give up. Thank you.
More than what i have stated above I don't know what else to say.
I am removing exiftool from my toolbar. Good luck!

Scriptero


Phil Harvey

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

sevy

QuoteCreate a .png file at specific size above 72 dpi. Run the exiftool with the -all tag and you WILL discover that the file size and resolution has changed. This is getting too frustrating for me...

I'm not an expert but I did it !
Here are the property tab of 3 files :
(a) source : I scanned a document, 300dpi (+/- A4 page)
(b) your command is run : it was not indicated but it was 72 dpi (see the print size change)
(c) I manually change 72dpi to 300 dpi with XnView (my default tool).

I do not see any difference between (a) and (c).

I had a similar problem with another tool (ImageCompositeEditor ICE) : I need to scan a document larger than possible (my purpose was to have a pdf file) with my flatbed scanner, so I scan this document in 2 parts (each 300 dpi png). Then I created a new document with ICE. The result was a.. 72 dpi png file :-(
I only had to manually change the resolution with XnView (also possible with other tools) and the result was ok.

I'm not an ExifTool specialist but I used it - with pleasure - to add metadata to jpg/pdf files for many years and until now, I never encountered your problem (but may be I don't understand it very well as English is not my primary language.)