Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with --insert and --extract in exiv2 app #1934

Open
postscript-dev opened this issue Sep 28, 2021 · 0 comments
Open

Problems with --insert and --extract in exiv2 app #1934

postscript-dev opened this issue Sep 28, 2021 · 0 comments
Assignees
Milestone

Comments

@postscript-dev
Copy link
Collaborator

postscript-dev commented Sep 28, 2021

Describe the bug

There are 4 problems:

  1. When extracting to a raw metadata file (.exv), if the file already exists, the data is not erased before writing. Instead the file is only updated with the extracted data. No warning is given, even when using --verbose.
  2. When extracting a thumbnail, this cannot be sent to stdout.
  3. When extracting to stdout, if --verbose is used, the output is corrupted by additional information.
  4. When attempting to insert from a raw metadata file (.exv), instead, the program attempts to insert an XMP sidecar file (.xmp). If the .xmp file exists, then the data is inserted and no warning is given, even with --verbose.

To Reproduce

  1. Extracting to a raw metadata file (.exv)
$ curl --silent -O https://www.exiv2.org/Stonehenge.jpg

# Extract the Exif, IPTC and XMP tags
$ exiv2 --verbose --extract XXxie Stonehenge.jpg
File 1/1: Stonehenge.jpg
Writing Exif data from Stonehenge.jpg to ./Stonehenge.exv
Writing IPTC data from Stonehenge.jpg to ./Stonehenge.exv
Writing XMP data from Stonehenge.jpg to ./Stonehenge.exv

# This time only extract the Exif and XMP tags
$ exiv2 --verbose --force --extract XXxe Stonehenge.jpg
File 1/1: Stonehenge.jpg
Writing Exif data from Stonehenge.jpg to ./Stonehenge.exv
Writing XMP data from Stonehenge.jpg to ./Stonehenge.exv

# The IPTC tags are still there
$ exiv2 --print a --grep Iptc Stonehenge.exv
Iptc.Envelope.ModelVersion                   Short       1  4
Iptc.Envelope.CharacterSet                   String      3
Iptc.Application2.RecordVersion              Short       1  4
Iptc.Application2.Caption                    String     12  Classic View
  1. Extracting a thumbnail to stdout
$ curl --silent -O https://www.exiv2.org/Stonehenge.jpg

# The stdout argument is ignored
$ exiv2 --verbose --extract t- Stonehenge.jpg
File 1/1: Stonehenge.jpg
Writing thumbnail (image/jpeg, 10837 Bytes) to file ./Stonehenge-thumb.jpg
  1. Extracting with --verbose and stdout
$ curl --silent -O https://www.exiv2.org/Stonehenge.jpg

# Attempt to extract XMP sidecar data
$ exiv2 --verbose --extract X- Stonehenge.jpg > Stonehenge.xmp
$ exiv2 --verbose --print a Stonehenge.xmp
File 1/1: Stonehenge.xmp
Exiv2 exception in print action for file Stonehenge.xmp:
Stonehenge.xmp: The file contains data of an unknown image type

# Attempt to extract raw metadata
$ exiv2 --verbose --extract XXeix- Stonehenge.jpg > Stonehenge.exv
$ exiv2 --verbose --print a Stonehenge.exv
File 1/1: Stonehenge.exv
Exiv2 exception in print action for file Stonehenge.exv:
Stonehenge.exv: The file contains data of an unknown image type
  1. Inserting from a raw metadata file (.exv)
$ curl --silent -O https://www.exiv2.org/Stonehenge.jpg

# Extract a raw metadata file
$ exiv2 --verbose --extract XXxie Stonehenge.jpg
File 1/1: Stonehenge.jpg
Writing Exif data from Stonehenge.jpg to ./Stonehenge.exv
Writing IPTC data from Stonehenge.jpg to ./Stonehenge.exv
Writing XMP data from Stonehenge.jpg to ./Stonehenge.exv

# Attempt to insert from a raw metadata file (.exv)
$ exiv2 --verbose --insert XXxie Stonehenge.jpg
File 1/1: Stonehenge.jpg
./Stonehenge.xmp: Failed to open the file

Desktop:

  • OS: MSYS2/MinGW64, but expected to be all
  • Exiv2: 0.27.4, 0.27.5 and main branches, but expected in previous versions
  • Compiler & Version: (main) g++.exe (Rev5, Built by MSYS2 project) 10.3.0
  • Compilation mode and/or compiler flags: None
@postscript-dev postscript-dev self-assigned this Sep 28, 2021
@postscript-dev postscript-dev changed the title Problems with --insert, --extract and --modify in exiv2 sample Problems with --insert and --extract in exiv2 sample Oct 15, 2021
@postscript-dev postscript-dev added this to the v1.00 milestone Oct 15, 2021
postscript-dev added a commit to postscript-dev/exiv2 that referenced this issue Oct 20, 2021
postscript-dev added a commit to postscript-dev/exiv2 that referenced this issue Oct 20, 2021
postscript-dev added a commit to postscript-dev/exiv2 that referenced this issue Oct 20, 2021
kevinbackhouse added a commit that referenced this issue Oct 26, 2021
postscript-dev added a commit to postscript-dev/exiv2 that referenced this issue Nov 16, 2021
Fix ignores `--verbose` when extracting to stdout.
postscript-dev added a commit to postscript-dev/exiv2 that referenced this issue Nov 16, 2021
Fix ignores `--verbose` when extracting to stdout.
kevinbackhouse added a commit that referenced this issue Dec 5, 2021
@postscript-dev postscript-dev changed the title Problems with --insert and --extract in exiv2 sample Problems with --insert and --extract in exiv2 app Nov 8, 2022
postscript-dev added a commit to postscript-dev/exiv2 that referenced this issue Nov 21, 2022
postscript-dev added a commit to postscript-dev/exiv2 that referenced this issue Nov 21, 2022
postscript-dev added a commit to postscript-dev/exiv2 that referenced this issue Nov 22, 2022
postscript-dev added a commit to postscript-dev/exiv2 that referenced this issue Nov 22, 2022
@kevinbackhouse kevinbackhouse modified the milestones: v0.28.0, Backlog Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants