Main Menu

DPI Changed

Started by rigsy88, August 19, 2021, 12:00:30 AM

Previous topic - Next topic

rigsy88

Hi there,

I have been using the exif tool for a while, and it is working well for me.

I did have an issue where one of my customers informed me that the DPI on their images had changed after I had ran it through the exif tool. Their images went from 300dpi to 96dpi.

Please excuse my ignorance, but is this normal behaviour? Is it possible to keep the DPI but remove all other data?

I am currently using the below command:

exiftool -overwrite_original -all= FILE

Thank you

Joanna Carter

Try putting

exiftool -overwrite_original -all= --jfif:Xresolution --jfif:Yresolution FILE

StarGeek

If you remove all metadata with -All=, then of course the resolution tags are going to be removed.

There are multiple places the resolution can be held, so try this command to see where the data is
exiftool -G1 -s -a -*Resolution file.jpg

You might try this command to make sure that the resolution tags are preserved.
exiftool -All= -TagsFromFile @ -Photoshop:all -JFIF:*Resolution* -EXIF:*Resolution* file.jpg
"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

Phil Harvey

Quote from: Joanna Carter on August 19, 2021, 11:00:24 AM
Try putting

exiftool -overwrite_original -all= --jfif:Xresolution --jfif:Yresolution FILE

You can't exclude individual tags from a mass delete.  Instead, assuming the resolutions are stored in JFIF, you would do this:

exiftool -overwrite_original -all= --jfjf:all FILE

since JFIF doesn't store much else other than the resolutions.

But StarGeek's idea will handle the more general case.

- 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

Phil, am I correct in assuming that the Photoshop resolution tags can't be created if the Photoshop block doesn't already exist?
"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

Phil Harvey

...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

Cool.  I faintly remembered something along those lines and that's why I included the -Photoshop:all in my command in case the Photoshop resolution tags were the important ones.
"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

rigsy88

Thank you all for the replies. I will give it a go today.

Joanna Carter

Quote from: Phil Harvey on August 19, 2021, 12:24:21 PM
Quote from: Joanna Carter on August 19, 2021, 11:00:24 AM
Try putting

exiftool -overwrite_original -all= --jfif:Xresolution --jfif:Yresolution FILE

You can't exclude individual tags from a mass delete.  Instead, assuming the resolutions are stored in JFIF, you would do this:

exiftool -overwrite_original -all= --jfjf:all FILE

since JFIF doesn't store much else other than the resolutions.

Thanks Phil. It was a case of a little knowledge being a dangerous thing  ::)

StarGeek

It's a mistake I've made before and had to be corrected about it on a StackExchange answer I posted.
"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