Comments (7)
Ah, I assumed you were using the asterisk as a placeholder. I don't think I've ever seen that construct used before. Using -All=
is the common approach, though this also suffers from the problem you describe.
I tried the command with some older versions back to 11.12 and the results were the same.
Furthermore, if you write another PNG tag at the same time, the PixelsPerUnit*
tags are not deleted nor updated.
C:\>exiftool -G1 -a -s -e --file:all Y:\!temp\test.png
[ExifTool] ExifToolVersion : 12.78
[PNG] ImageWidth : 768
[PNG] ImageHeight : 1152
[PNG] BitDepth : 8
[PNG] ColorType : RGB
[PNG] Compression : Deflate/Inflate
[PNG] Filter : Adaptive
[PNG] Interlace : Noninterlaced
[PNG-pHYs] PixelsPerUnitX : 5909
[PNG-pHYs] PixelsPerUnitY : 5909
[PNG-pHYs] PixelUnits : meters
C:\>exiftool -P -overwrite_original -all= -PixelsPerUnit?=100 -Description=Description Y:\!temp\test.png
1 image files updated
C:\>exiftool -G1 -a -s -e --file:all Y:\!temp\test.png
[ExifTool] ExifToolVersion : 12.78
[PNG] ImageWidth : 768
[PNG] ImageHeight : 1152
[PNG] BitDepth : 8
[PNG] ColorType : RGB
[PNG] Compression : Deflate/Inflate
[PNG] Filter : Adaptive
[PNG] Interlace : Noninterlaced
[PNG] Description : Description
[PNG-pHYs] PixelsPerUnitX : 5909
[PNG-pHYs] PixelsPerUnitY : 5909
[PNG-pHYs] PixelUnits : meters
Phil will have to look at this when he gets the chance.
from exiftool.
What command line are you using (Powershell/CMD/Bash/Terminal/etc)? What version of exiftool? What is your exact command?
It works correctly here with ver 12.78 on Windows CMD
C:\>exiftool -ver
12.78
C:\>exiftool -P -overwrite_original -PixelsPerUnit?=5906 Y:\!temp\test.png
1 image files updated
C:\>exiftool -G1 -a -s -PixelsPerUnit? Y:\!temp\test.png
[PNG-pHYs] PixelsPerUnitX : 5906
[PNG-pHYs] PixelsPerUnitY : 5906
from exiftool.
ExifTool 12.78.
Commands are specifically adjusted to work across Unix Shell, Windows CMD, PowerShell.
[[
exiftool -v5 "-*=" "-PixelsPerUnit?=5906" -overwrite_original "!.png"
exiftool -U -ee3 -g3:5:2 -api "RequestAll=0" -api "LargeFileSupport" "!.png"
]]
from exiftool.
You can see the reason for this if you add the -v2 option when writing:
Writing PNG-pHYs:PixelsPerUnitX if tag exists
Writing PNG-pHYs:PixelsPerUnitY if tag exists
@Stargeek: "-*=" is the same as "-all="
- Phil
from exiftool.
Yeah, I thought they were the same when I saw it, I just never seen it written like that.
But I think still think there's something wrong, as per my second example. In that example, PixelsPerUnitX
/PixelsPerUnitY
are preset to a value of 5906. I use -all=
to clear the data, -PixelsPerUnit?=100
to set new values, and add a Description
. The Description
is written, but PixelsPerUnitX
/PixelsPerUnitY
are not changed.
The -v2
(-verbose2
) option shows this output (edited)
Deleting tags in: <snip> PNG PNG-pHYs <snip>
Writing PNG-pHYs:PixelsPerUnitX if tag exists
Writing PNG-pHYs:PixelsPerUnitY if tag exists
Writing new tags after deleting groups: <snip> PNG PNG-pHYs <snip>
Writing PNG:Description
Writing ItemList:Description if tag exists
Writing Keys:Description if tag exists
Writing UserData:Description if tag exists
<etc…snip>
======== Y:/!temp/test.png
Rewriting Y:/!temp/test.png...
Editing tags in: <snip> PNG PNG-pHYs <snip>
Creating tags in: PNG PNG-pHYs
<snip>
PNG pHYs (9 bytes):
Deleting PNG-pHYs
Rewriting PNG-pHYs
PNG tEXt (23 bytes):
- PNG:Description = 'Description'
+ PNG:Description = 'Description'
PNG IDAT (20 chunks, total 1289244 bytes)
PNG IEND (end of image)
1 image files updated
Even if I explicitly set both tags to a new value, the old one remains
C:\>exiftool -P -overwrite_original -all= -PixelsPerUnitX=100 -PixelsPerUnitY=100 -Description=Description Y:\!temp\test.png
1 image files updated
C:\>exiftool -G1 -a -s -Description -PNG-pHYs:all Y:/!temp/test.png
[PNG] Description : Description
[PNG-pHYs] PixelsPerUnitX : 5906
[PNG-pHYs] PixelsPerUnitY : 5906
[PNG-pHYs] PixelUnits : meters
from exiftool.
I agree that something odd is happening here, but I can't reproduce your exact observations. I need to look at this in more detail.
- Phil
from exiftool.
"Writing PNG-pHYs:PixelsPerUnitX if tag exists"
<.> The behavior is inconsistent with similar JPEG writing.
(see main post)
from exiftool.
Related Issues (20)
- Error accessing MIE files in version 12.74 HOT 3
- JSON detected as wrong type if array containing object is MIMEtype HOT 1
- Missing TIFF-EPStandardID interpretation HOT 2
- Clarify JXL read/write support HOT 2
- Encode mp3 tags in UTF8 HOT 9
- Microsoft Xtra tags - expand writable tags HOT 16
- Unable to update MAKE tag using exiftool 12.76 HOT 3
- consider a default behavior of reading mkv tags after the first cluster if indexed in the seekhead HOT 3
- Problematic handling of non-ASCII filenames on Windows HOT 21
- New Samsung GCamera XMP tags HOT 9
- [Suggestion] Report more modern variant of TTF MIME type?
- [Suggestion] New way of representing Palette in human-readable format HOT 2
- Firmware Versions, Canon 7D (or - strangeness recovering certain data) HOT 2
- [Enhancement] TIFF metadata stripping HOT 1
- Add Character Count too? ("Document" type)
- Deployment instruction HOT 2
- Is exiftool.org down completely? HOT 1
- `-J` exports incorrectly outputs ExifToolVersion as a float HOT 2
- "PNG-PrimaryChromaticities" "PNG-CICodePoints" alike not handled
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exiftool.