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

Fix misc exiv2 app bugs #2425

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@ int metacopy(const std::string& source, const std::string& tgt, Exiv2::ImageType
std::string target(bStdout ? temporaryPath() : tgt);

std::unique_ptr<Exiv2::Image> targetImage;
if (Exiv2::fileExists(target)) {
if (preserve && Exiv2::fileExists(target)) {
targetImage = Exiv2::ImageFactory::open(target);
targetImage->readMetadata();
} else {
Expand Down
Binary file added test/data/pr_2425_poc1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions tests/bugfixes/github/test_pr_2425.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-

from system_tests import CaseMeta, CopyTmpFiles, path

@CopyTmpFiles("$data_path/pr_2425_poc1.jpg")
class testExiv2AppExtractOverrideFile(metaclass=CaseMeta):
url = "https://github.com/Exiv2/exiv2/issues/2425"
description = "Fix bug 1. reported in https://github.com/Exiv2/exiv2/issues/1934"

filename_jpg = "$tmp_path/pr_2425_poc1.jpg"
filename_exv = "$tmp_path/pr_2425_poc1.exv"

commands = ["$exiv2 --force --extract XXeix $filename_jpg",
"$exiv2 --print a $filename_exv",
"$exiv2 --force --extract XXex $filename_jpg",
"$exiv2 --print a $filename_exv"]

retval = [0]*4
stderr = [""]*4
stdout = ["""""",
"""Exif.Image.ImageDescription Ascii 11 Test image
Iptc.Application2.Subject String 12 Test subject
Xmp.dc.subject XmpBag 1 Test subject
""",
"""""",
"""Exif.Image.ImageDescription Ascii 11 Test image
Xmp.dc.subject XmpBag 1 Test subject
"""]
3 changes: 1 addition & 2 deletions tests/bugfixes/redmine/test_issue_751.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def read_xmpfile():
"",
"""Warning: Updating namespace URI for imageapp from orig/ to dest/
""",
"""Warning: Updating namespace URI for imageapp from dest/ to orig/
""",
"""""",
]
retval = [0] * 4
1 change: 1 addition & 0 deletions tests/regression_tests/test_regression_allfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def get_valid_files(data_dir):
# different output let's try and fix this later
"exiv2-bug1044.tif",
"issue_2403_poc.exv",
"pr_2425_poc1.jpg",
]

file_paths = [
Expand Down