ExifTool Forum

General => Metadata => Topic started by: rigsy88 on August 19, 2021, 12:00:30 AM

Title: DPI Changed
Post by: rigsy88 on August 19, 2021, 12:00:30 AM
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
Title: Re: DPI Changed
Post by: Joanna Carter on August 19, 2021, 11:00:24 AM
Try putting

exiftool -overwrite_original -all= --jfif:Xresolution --jfif:Yresolution FILE
Title: Re: DPI Changed
Post by: StarGeek on August 19, 2021, 11:03:01 AM
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
Title: Re: DPI Changed
Post by: 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.

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

- Phil
Title: Re: DPI Changed
Post by: StarGeek on August 19, 2021, 12:30:07 PM
Phil, am I correct in assuming that the Photoshop resolution tags can't be created if the Photoshop block doesn't already exist?
Title: Re: DPI Changed
Post by: Phil Harvey on August 19, 2021, 12:41:39 PM
Correct.
Title: Re: DPI Changed
Post by: StarGeek on August 19, 2021, 03:53:54 PM
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.
Title: Re: DPI Changed
Post by: rigsy88 on August 19, 2021, 05:11:31 PM
Thank you all for the replies. I will give it a go today.
Title: Re: DPI Changed
Post by: Joanna Carter on August 20, 2021, 04:37:44 AM
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  ::)
Title: Re: DPI Changed
Post by: StarGeek on August 20, 2021, 11:37:49 AM
It's a mistake I've made before and had to be corrected about it on a StackExchange answer I posted.