Giter Site home page Giter Site logo

Comments (7)

StarGeekSpaceNerd avatar StarGeekSpaceNerd commented on June 3, 2024 1

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.

StarGeekSpaceNerd avatar StarGeekSpaceNerd commented on June 3, 2024

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.

MasterInQuestion avatar MasterInQuestion commented on June 3, 2024

    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.

boardhead avatar boardhead commented on June 3, 2024

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.

StarGeekSpaceNerd avatar StarGeekSpaceNerd commented on June 3, 2024

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.

boardhead avatar boardhead commented on June 3, 2024

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.

MasterInQuestion avatar MasterInQuestion commented on June 3, 2024

    "Writing PNG-pHYs:PixelsPerUnitX if tag exists"
<.>    The behavior is inconsistent with similar JPEG writing.
    (see main post)

from exiftool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.