[Solved] How to change resolution metadata of a lossy image format like JPEG without recompression?

Having tech problems? Post them here and do not worry, there is always a solution for you.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: How to change resolution metadata of a lossy image format like JPEG without recompression?

Post by forum_adm »

Did you check: Always Add Exif?
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: How to change resolution metadata of a lossy image format like JPEG without recompression?

Post by forum_adm »

I rechecked with build 6125. The resolution of WebP is updated and shown in the browser.

But this works for WebP only if this option is active:
Screenshot 2023-05-22 at 08.43.jpg
Screenshot 2023-05-22 at 08.43.jpg (88.3 KiB) Viewed 1722 times
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: How to change resolution metadata of a lossy image format like JPEG without recompression?

Post by porg »

"Change resolution lossless…" with the option "Always create EXIF"

1) Test result in GC v12 b6125:

✅ WEBPs get their resolution changed.

❗️ But I get the same followup bug as in Save for Web: Browser column falsely shows resolution for WEBP files as 72 DPI regardless of real resolution

2) Feedback on the label "Always create EXIF":
- Sounds too general, could possibly evoke false interpretations: Not specific to this action, but that this is for WEBP or all files in general.
- Space is not an issue in this dialog. Better be specific and avoid extra documentation & support:

Code: Select all

☐ Add metadata structure to file(s) if needed

If the processed file has no metadata structure yet,
this option will add one, which is a necessity to store the resolution info.

The metadata structure is file format specific:
- JPEG: EXIF header
- WEBP: EXIF chunk towards the file end
- PNG: pHYs tag
👆 Or whatever is actually the case. Above text is exemplary.
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: How to change resolution metadata of a lossy image format like JPEG without recompression?

Post by porg »

@forum_adm

1) In my previous post I proposed "metadata structure" as a more file format neutral terminology. Btw this new block should come last. On top the input, then the live preview calculations in cm and inch, then the option with the new label + explanation. Reaction appreciated.

2) Regarding PNGs this dialog totally misbehaves: PNG-pHYs is not updated at all. And EXIF IFD0 X / Y Resolution tags are ALWAYS added also when I have chosen "Always create EXIF" OFF. Tested in GC v12 b6132.

GraphicConverter 12 b6132 Change resolution lossless in PNG misses PNG-pHYs totally and always writes EXIF also when OFF.png
GraphicConverter 12 b6132 Change resolution lossless in PNG misses PNG-pHYs totally and always writes EXIF also when OFF.png (411.76 KiB) Viewed 1709 times
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: How to change resolution metadata of a lossy image format like JPEG without recompression?

Post by forum_adm »

Ok, I will recheck the ExifTool command.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: How to change resolution metadata of a lossy image format like JPEG without recompression?

Post by forum_adm »

I changed the function now. So, it should be self explaining:
Screenshot 2023-05-26 at 18.57.55.jpg
Screenshot 2023-05-26 at 18.57.55.jpg (68.26 KiB) Viewed 1702 times
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: How to change resolution metadata of a lossy image format like JPEG without recompression?

Post by porg »

✅ Very good labels now: Very transparent what will happen, while still being short.

✅ Tested in GC v12 b6133, and they work

❗️ Feature wise some differentiation is missing:

1. Change only existing tags (may not change anything) → "Absolute scarcity mode".

2. Always write Exif tags, JFIF for JPEGs and pHYs for PNGs → "Absolute oversaturation mode"

• If a JPEG had only a JFIF tag or a PNG only a pPHYs tag, it gets an extra unnecessary Exif on top.
• Not that the bytes matter too much. But having attributes in multiple tags, poses the danger of later "running out of sync" given bad software later in the file's lifecycle. Hence "less is better".
• Well then why don't you select option 1 then, dummy?
• Answer: Working with heterogenous file sets: Some have no tags at all, some have only JFIF, some only pHYs, some only Exif, some may have multiple tags.
• Recommendation: There should be "middle ground" options too.

💡 Proposal: Change the label "Mode:" to "Per file:" and offer a dropdown with 4 choices:

Code: Select all

Per file:  [ Try existing tag only. If inexistent nothing changes.    ▾ ]
             Try existing tag. If inexistent add JFIF or pHYs.
             Try existing tag. If inexistent add Exif.
             Always write Exif tag + JFIF for JPEGs and pHYs for PNGs
Post Reply