Coder Social home page Coder Social logo

Comments (3)

iblazhko avatar iblazhko commented on July 18, 2024

In case this may be useful to someone having the same issue: as a workaround, I am piping exiv2 -PVk output through sed to trim trailing whitespaces, result can be processed by exiv2 -m-:

exiv2 -PVk \
  -K Exif.Image.DateTime \
  -K Exif.Image.Make \
  -K Exif.Image.Model \
  -K Exif.Photo.LensMake \
  -K Exif.Photo.LensModel \
  source.jpg \
| sed -e 's/[[:space:]]*$//' \
| exiv2 -m- target.jpg

from exiv2.

kamiccolo avatar kamiccolo commented on July 18, 2024

I was about to state, that it may not be a bug, but rather a feature. But found this on the manual:

In the file, any blank lines or additional white space is ignored and any lines beginning with a # are comments.

Also, from the same manual:

value The remaining text on the line is the value, and can optionally be enclosed in quotes (see Quotations with 'modify' commands). For Ascii, XmpAlt, XmpBag, XmpSeq and XmpText, the value is optional which is equivalent to an empty value ("")

So, it's seams like expected behavior is not to differentiate between the following of examples You've provided:

exiv2 -M "set Exif.Photo.LensMake Ascii " image.jpg

exiv2 -M "set Exif.Photo.LensMake Ascii" image.jpg

Relevant (I guess) parts of the source:

  1. https://github.com/Exiv2/exiv2/blob/main/app/exiv2.cpp#L1234-L1257 (reading the lines)
  2. https://github.com/Exiv2/exiv2/blob/main/app/exiv2.cpp#L1302-L1426 (parsing the line)
  3. https://github.com/Exiv2/exiv2/blob/main/app/exiv2.cpp#L1363-L1405 (parsing the value, I guess the culprit is here)

from exiv2.

iblazhko avatar iblazhko commented on July 18, 2024

Thanks for confirming my assumptions.

Whatever the parsing rules are, I think it is a fair expectation that exiv2 -m should be able to consume what exiv2 -Pvk produces.

from exiv2.

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.