-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
// Sample program to dump the XMP packet of an image | ||
|
||
#include <exiv2/exiv2.hpp> | ||
#include <exiv2/image_types.hpp> | ||
#include <iostream> | ||
|
||
int main(int argc, char* const argv[]) { | ||
try { | ||
if (argc != 2) { | ||
std::cout << "Usage: " << argv[0] << " file\n"; | ||
return EXIT_FAILURE; | ||
} | ||
|
||
auto image = Exiv2::ImageFactory::open(argv[1]); | ||
if (image->imageType() == Exiv2::ImageType::jpeg) { | ||
Exiv2::JpegImage* jpegImage = dynamic_cast<Exiv2::JpegImage*>(image.get()); | ||
jpegImage->readMetadata(); | ||
std::cout << "Number of color components: " << jpegImage->numColorComponents() << "\n"; | ||
std::cout << "Encoding process: " << jpegImage->encodingProcess() << "\n"; | ||
} | ||
|
||
return EXIT_SUCCESS; | ||
} catch (Exiv2::Error& e) { | ||
std::cout << "Caught Exiv2 exception '" << e << "'\n"; | ||
return EXIT_FAILURE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import system_tests | ||
|
||
class TestExifIPTCXmpTagOutput(metaclass=system_tests.CaseMeta): | ||
url = "https://github.com/Exiv2/exiv2/pull/2279" | ||
|
||
# Test extraction of jpeg specific metadata | ||
filename = "$data_path/exiv2-fujifilm-finepix-s2pro.jpg" | ||
commands = ["$jpegparsetest $filename"] | ||
stderr = [""] * len(commands) | ||
stdout = ["""Number of color components: 3\nEncoding process: Baseline DCT, Huffman coding\n"""] | ||
retval = [0] * len(commands) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters