[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:47:04 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=3cfecd4
The following commit has been merged in the master branch:
commit 3cfecd49182716c0b18a5dd900ec90861ad6b11f
Author: Robin Mills <robin at clanmills.com>
Date: Mon Sep 26 17:47:32 2016 +0000
#1230 Extended test/stdin-test.sh to pipe .exv and .icc file structures
---
src/actions.cpp | 214 ++++++++++++++++++++++++-----------------------
src/actions.hpp | 8 +-
src/exiv2.cpp | 1 +
test/data/stdin-test.out | 214 +++++++++++++++++++++++++++++++++++++++++++++++
test/stdin-test.sh | 21 ++++-
5 files changed, 346 insertions(+), 112 deletions(-)
diff --git a/src/actions.cpp b/src/actions.cpp
index 591d3e6..6fc1ff6 100644
--- a/src/actions.cpp
+++ b/src/actions.cpp
@@ -249,11 +249,11 @@ namespace Action {
case Params::pmRecursive: rc = printStructure(std::cout,Exiv2::kpsRecursive) ; break;
case Params::pmXMP:
- option = option == Exiv2::kpsNone ? Exiv2::kpsXMP : option; // drop
+ option = option == Exiv2::kpsNone ? Exiv2::kpsXMP : option; // drop
case Params::pmIccProfile:{
- option = option == Exiv2::kpsNone ? Exiv2::kpsIccProfile : option;
+ option = option == Exiv2::kpsNone ? Exiv2::kpsIccProfile : option;
_setmode(_fileno(stdout),O_BINARY);
- rc = printStructure(std::cout,option);
+ rc = printStructure(std::cout,option);
} break;
}
return rc;
@@ -845,9 +845,8 @@ namespace Action {
return -1;
}
Timestamp ts;
- if (Params::instance().preserve_) {
- ts.read(path);
- }
+ if (Params::instance().preserve_) ts.read(path);
+
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path);
assert(image.get() != 0);
image->readMetadata();
@@ -935,9 +934,8 @@ namespace Action {
return -1;
}
Timestamp ts;
- if (Params::instance().preserve_) {
- ts.read(path);
- }
+ if (Params::instance().preserve_) ts.read(path);
+
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path_);
assert(image.get() != 0);
image->readMetadata();
@@ -967,9 +965,7 @@ namespace Action {
if (0 == rc) {
image->writeMetadata();
- }
- if (Params::instance().preserve_) {
- ts.touch(path);
+ if (Params::instance().preserve_) ts.touch(path);
}
return rc;
@@ -1072,24 +1068,23 @@ namespace Action {
path_ = path;
int rc = 0;
- if ( Params::instance().target_ & Params::ctStdInOut ) {
- _setmode(_fileno(stdout),O_BINARY);
- }
+ bool bStdout = Params::instance().target_ & Params::ctStdInOut;
+ if (bStdout) _setmode(_fileno(stdout), _O_BINARY) ;
if (!rc && Params::instance().target_ & Params::ctThumb) {
rc = writeThumbnail();
}
+ if (!rc && Params::instance().target_ & Params::ctPreview) {
+ rc = writePreviews();
+ }
if (!rc && Params::instance().target_ & Params::ctXmpSidecar) {
- std::string xmpPath = Params::instance().target_ & Params::ctStdInOut
- ? "-" : newFilePath(path_, ".xmp");
+ std::string xmpPath = bStdout ? "-" : newFilePath(path_, ".xmp");
if (dontOverwrite(xmpPath)) return 0;
rc = metacopy(path_, xmpPath, Exiv2::ImageType::xmp, false);
}
- if (!rc && Params::instance().target_ & Params::ctPreview) {
- rc = writePreviews();
- }
if (!rc && Params::instance().target_ & Params::ctIccProfile) {
- rc = writeIccProfile();
+ std::string iccPath = bStdout ? "-" : newFilePath(path_,".icc");
+ rc = writeIccProfile(iccPath);
}
if (!rc
&& !(Params::instance().target_ & Params::ctXmpSidecar)
@@ -1097,8 +1092,7 @@ namespace Action {
&& !(Params::instance().target_ & Params::ctPreview)
&& !(Params::instance().target_ & Params::ctIccProfile)
) {
- std::string exvPath = Params::instance().target_ & Params::ctStdInOut
- ? "-" : newFilePath(path_, ".exv");
+ std::string exvPath = bStdout ? "-" : newFilePath(path_, ".exv");
if (dontOverwrite(exvPath)) return 0;
rc = metacopy(path_, exvPath, Exiv2::ImageType::exv, false);
}
@@ -1186,7 +1180,7 @@ namespace Action {
return 0;
} // Extract::writePreviews
- int Extract::writeIccProfile() const
+ int Extract::writeIccProfile(const std::string& target) const
{
int rc = 0;
if (!Exiv2::fileExists(path_, true)) {
@@ -1195,6 +1189,8 @@ namespace Action {
rc = -1;
}
+ bool bStdout = target == "-" ;
+
if ( rc == 0 ) {
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path_);
assert(image.get() != 0);
@@ -1204,14 +1200,13 @@ namespace Action {
rc = -2;
} else {
- if ( Params::instance().target_ & Params::ctStdInOut ) { // -eC-
+ if ( bStdout ) { // -eC-
std::cout.write((const char*)image->iccProfile()->pData_,image->iccProfile()->size_);
} else {
- std::string iccPath = newFilePath(path_,".icc");
if (Params::instance().verbose_) {
- std::cout << _("Writing iccProfile: ") << iccPath << std::endl;
+ std::cout << _("Writing iccProfile: ") << target << std::endl;
}
- Exiv2::FileIo iccFile(iccPath);
+ Exiv2::FileIo iccFile(target);
iccFile.open("wb") ;
iccFile.write(image->iccProfile()->pData_,image->iccProfile()->size_);
iccFile.close();
@@ -1260,30 +1255,23 @@ namespace Action {
int Insert::run(const std::string& path)
try {
+ // -i{tgt}- reading from stdin?
+ bool bStdin = (Params::instance().target_ & Params::ctStdInOut)?true:false;
+
if (!Exiv2::fileExists(path, true)) {
std::cerr << path
<< ": " << _("Failed to open the file
");
return -1;
}
- if ( Params::instance().target_ & Params::ctStdInOut ) {
- _setmode(_fileno(stdin),O_BINARY);
- }
-
int rc = 0;
Timestamp ts;
- if (Params::instance().preserve_) {
- ts.read(path);
- }
+ if (Params::instance().preserve_) ts.read(path);
+
if (Params::instance().target_ & Params::ctThumb) {
rc = insertThumbnail(path);
}
- // -i{tgt}- reading from stdin?
- Exiv2::DataBuf stdIn;
- bool bStdin = (Params::instance().target_ & Params::ctStdInOut)?true:false;
- if ( bStdin ) Params::instance().getStdin(stdIn);
-
if ( rc == 0 && !(Params::instance().target_ & Params::ctXmpRaw)
&& ( Params::instance().target_ & Params::ctExif
|| Params::instance().target_ & Params::ctIptc
@@ -1294,22 +1282,21 @@ namespace Action {
std::string suffix = Params::instance().suffix_;
if (suffix.empty()) suffix = ".exv";
if (Params::instance().target_ & Params::ctXmpSidecar) suffix = ".xmp";
- std::string exvPath = newFilePath(path, suffix);
+ std::string exvPath = bStdin ? "-" : newFilePath(path, suffix);
rc = metacopy(exvPath, path, Exiv2::ImageType::none, true);
}
if (0 == rc && (Params::instance().target_ & (Params::ctXmpSidecar|Params::ctXmpRaw)) ) {
- std::string xmpPath = newFilePath(path,".xmp");
- rc = bStdin ? insertXmpPacket(path,stdIn,bStdin) : insertXmpPacket(path,xmpPath);
+ std::string xmpPath = bStdin ? "-" : newFilePath(path,".xmp");
+ rc = insertXmpPacket(path,xmpPath);
}
if (0 == rc && Params::instance().target_ & Params::ctIccProfile) {
- rc = bStdin ? insertIccProfile(path,stdIn): insertIccProfile(path);
+ std::string iccPath = bStdin ? "-" : newFilePath(path,".icc");
+ rc = insertIccProfile(path,iccPath);
}
- if (Params::instance().preserve_) {
- ts.touch(path);
- }
+ if (Params::instance().preserve_) ts.touch(path);
return rc;
}
catch(const Exiv2::AnyError& e)
@@ -1321,19 +1308,31 @@ namespace Action {
int Insert::insertXmpPacket(const std::string& path,const std::string& xmpPath) const
{
- if (!Exiv2::fileExists(xmpPath, true)) {
- std::cerr << xmpPath
- << ": " << _("Failed to open the file
");
- return -1;
- }
- if (!Exiv2::fileExists(path, true)) {
- std::cerr << path
- << ": " << _("Failed to open the file
");
- return -1;
+ int rc = 0;
+ bool bStdin = xmpPath == "-" ;
+ if ( bStdin ) {
+ Exiv2::DataBuf xmpBlob;
+ Params::instance().getStdin(xmpBlob);
+ rc = insertXmpPacket(path,xmpBlob,true);
+ } else {
+ if (!Exiv2::fileExists(xmpPath, true)) {
+ std::cerr << xmpPath
+ << ": " << _("Failed to open the file
");
+ rc = -1;
+ }
+ if (rc == 0 && !Exiv2::fileExists(path, true)) {
+ std::cerr << path
+ << ": " << _("Failed to open the file
");
+ rc = -1;
+ }
+ if ( rc == 0 ) {
+ Exiv2::DataBuf xmpBlob = Exiv2::readFile(xmpPath);
+ rc = insertXmpPacket(path,xmpBlob);
+ }
}
- Exiv2::DataBuf xmpBlob = Exiv2::readFile(xmpPath);
- return insertXmpPacket(path,xmpBlob);
- }
+ return rc;
+
+ } // Insert::insertXmpPacket
int Insert::insertXmpPacket(const std::string& path,const Exiv2::DataBuf& xmpBlob,bool usePacket) const
{
@@ -1352,24 +1351,28 @@ namespace Action {
return 0;
}
- int Insert::insertIccProfile(const std::string& path) const
+ int Insert::insertIccProfile(const std::string& path,const std::string& iccPath) const
{
int rc = 0;
// for path "foo.XXX", do a binary copy of "foo.icc"
std::string iccProfilePath = newFilePath(path, ".icc");
- if (!Exiv2::fileExists(iccProfilePath, true)) {
- std::cerr << iccProfilePath
- << ": " << _("Failed to open the file
");
- rc = -1;
+ if ( iccPath == "-" ) {
+ Exiv2::DataBuf iccProfile ;
+ Params::instance().getStdin(iccProfile);
+ rc = insertIccProfile(path,iccProfile);
} else {
- Exiv2::DataBuf iccProfileBlob = Exiv2::readFile(iccProfilePath);
- rc = insertIccProfile(path,iccProfileBlob);
+ if (!Exiv2::fileExists(iccProfilePath, true)) {
+ std::cerr << iccProfilePath
+ << ": " << _("Failed to open the file
");
+ rc = -1;
+ } else {
+ Exiv2::DataBuf iccProfile = Exiv2::readFile(iccPath);
+ rc = insertIccProfile(path,iccProfile);
+ }
}
return rc;
-
} // Insert::insertIccProfile
-
int Insert::insertIccProfile(const std::string& path,Exiv2::DataBuf& iccProfileBlob) const
{
int rc = 0;
@@ -1442,9 +1445,8 @@ namespace Action {
return -1;
}
Timestamp ts;
- if (Params::instance().preserve_) {
- ts.read(path);
- }
+ if (Params::instance().preserve_) ts.read(path);
+
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path);
assert(image.get() != 0);
image->readMetadata();
@@ -1454,9 +1456,8 @@ namespace Action {
// Save both exif and iptc metadata
image->writeMetadata();
- if (Params::instance().preserve_) {
- ts.touch(path);
- }
+ if (Params::instance().preserve_) ts.touch(path);
+
return rc;
}
catch(const Exiv2::AnyError& e)
@@ -1685,9 +1686,8 @@ namespace Action {
return -1;
}
Timestamp ts;
- if (Params::instance().preserve_) {
- ts.read(path);
- }
+ if (Params::instance().preserve_) ts.read(path);
+
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path);
assert(image.get() != 0);
image->readMetadata();
@@ -1700,12 +1700,12 @@ namespace Action {
int rc = adjustDateTime(exifData, "Exif.Image.DateTime", path);
rc += adjustDateTime(exifData, "Exif.Photo.DateTimeOriginal", path);
rc += adjustDateTime(exifData, "Exif.Photo.DateTimeDigitized", path);
- if (rc) return 1;
- image->writeMetadata();
- if (Params::instance().preserve_) {
- ts.touch(path);
+
+ if (rc == 0 ) {
+ image->writeMetadata();
+ if (Params::instance().preserve_) ts.touch(path);
}
- return rc;
+ return rc?1:0;
}
catch(const Exiv2::AnyError& e)
{
@@ -1821,9 +1821,8 @@ namespace Action {
return -1;
}
Timestamp ts;
- if (Params::instance().preserve_) {
- ts.read(path);
- }
+ if (Params::instance().preserve_) ts.read(path);
+
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path);
assert(image.get() != 0);
image->readMetadata();
@@ -1850,9 +1849,8 @@ namespace Action {
exifData["Exif.Photo.ISOSpeedRatings"] = os.str();
}
image->writeMetadata();
- if (Params::instance().preserve_) {
- ts.touch(path);
- }
+ if (Params::instance().preserve_) ts.touch(path);
+
return 0;
}
catch(const Exiv2::AnyError& e)
@@ -1886,9 +1884,8 @@ namespace Action {
return -1;
}
Timestamp ts;
- if (Params::instance().preserve_) {
- ts.read(path);
- }
+ if (Params::instance().preserve_) ts.read(path);
+
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path);
assert(image.get() != 0);
image->readMetadata();
@@ -1928,9 +1925,8 @@ namespace Action {
// Remove BOM and convert value from source charset to UCS-2, but keep byte order
pos->setValue(comment);
image->writeMetadata();
- if (Params::instance().preserve_) {
- ts.touch(path);
- }
+ if (Params::instance().preserve_) ts.touch(path);
+
return 0;
}
catch(const Exiv2::AnyError& e)
@@ -2048,6 +2044,10 @@ namespace {
int targetType,
bool preserve)
{
+#ifdef DEBUG
+ std::cerr << "actions.cpp::metacopy" << " source = " << source << " target = " << tgt << std::endl;
+#endif
+
// read the source metadata
int rc = -1 ;
if (!Exiv2::fileExists(source, true)) {
@@ -2056,7 +2056,14 @@ namespace {
return rc;
}
- Exiv2::Image::AutoPtr sourceImage = Exiv2::ImageFactory::open(source);
+ bool bStdin = source == "-";
+ bool bStdout = tgt == "-";
+
+ Exiv2::DataBuf stdIn;
+ if ( bStdin ) Params::instance().getStdin(stdIn);
+ Exiv2::BasicIo::AutoPtr ioStdin = Exiv2::BasicIo::AutoPtr(new Exiv2::MemIo(stdIn.pData_,stdIn.size_));
+
+ Exiv2::Image::AutoPtr sourceImage = bStdin ? Exiv2::ImageFactory::open(ioStdin) : Exiv2::ImageFactory::open(source);
assert(sourceImage.get() != 0);
sourceImage->readMetadata();
@@ -2064,18 +2071,14 @@ namespace {
Action::Modify::applyCommands(sourceImage.get());
// Open or create the target file
- std::string target = tgt;
- bool bTemporary = target == "-";
- if ( bTemporary ) {
- target = Exiv2::FileIo::temporaryPath();
- }
+ std::string target = bStdout ? Exiv2::FileIo::temporaryPath() : tgt;
+
Exiv2::Image::AutoPtr targetImage;
if (Exiv2::fileExists(target)) {
targetImage = Exiv2::ImageFactory::open(target);
assert(targetImage.get() != 0);
targetImage->readMetadata();
- }
- else {
+ } else {
targetImage = Exiv2::ImageFactory::create(targetType, target);
assert(targetImage.get() != 0);
}
@@ -2160,8 +2163,10 @@ namespace {
}
// if we used a temporary target, copy it to stdout
- if ( rc == 0 && bTemporary ) {
+ if ( rc == 0 && bStdout ) {
FILE* f = ::fopen(target.c_str(),"rb") ;
+ _setmode(_fileno(stdout),O_BINARY);
+
if ( f ) {
char buffer[8*1024];
size_t n = 1 ;
@@ -2171,11 +2176,10 @@ namespace {
}
fclose(f);
}
- std::cout << std::endl;
}
// delete temporary target
- if ( bTemporary ) std::remove(target.c_str());
+ if ( bStdout ) std::remove(target.c_str());
return rc;
} // metacopy
diff --git a/src/actions.hpp b/src/actions.hpp
index 24a279f..01c9e2d 100644
--- a/src/actions.hpp
+++ b/src/actions.hpp
@@ -321,7 +321,7 @@ namespace Action {
/*!
@brief Write embedded iccProfile files.
*/
- int writeIccProfile() const;
+ int writeIccProfile(const std::string& path) const;
private:
virtual Extract* clone_() const;
@@ -356,11 +356,9 @@ namespace Action {
int insertXmpPacket(const std::string& path,const Exiv2::DataBuf& xmpBlob,bool usePacket=false) const;
/*!
- @brief Insert an ICC profile from a file into file \em path.
- The filename of the ICC profile is expected to be the image
- filename (\em path) minus its suffix plus ".icc".
+ @brief Insert an ICC profile from iccPath into file \em path.
*/
- int insertIccProfile(const std::string& path) const;
+ int insertIccProfile(const std::string& path,const std::string& iccPath) const;
/*!
@brief Insert an ICC profile from binary DataBuf into file \em path.
*/
diff --git a/src/exiv2.cpp b/src/exiv2.cpp
index 428706a..1158b36 100644
--- a/src/exiv2.cpp
+++ b/src/exiv2.cpp
@@ -902,6 +902,7 @@ static int readFileToBuf(FILE* f,Exiv2::DataBuf& buf)
return nBytes;
}
+//#define DEBUG
void Params::getStdin(Exiv2::DataBuf& buf)
{
// copy stdin to stdinBuf
diff --git a/test/data/stdin-test.out b/test/data/stdin-test.out
index af0085e..70fe682 100644
--- a/test/data/stdin-test.out
+++ b/test/data/stdin-test.out
@@ -105,3 +105,217 @@ STRUCTURE OF JPEG FILE: girl.jpg
</rdf:RDF>
</x:xmpmeta>
<?xpacket end='w'?>
+STRUCTURE OF JPEG FILE: girl.jpg
+ address | marker | length | data
+ 0 | 0xffd8 SOI
+ 2 | 0xffe0 APP0 | 16 | JFIF............
+ 20 | 0xffdb DQT | 67
+ 89 | 0xffdb DQT | 67
+ 158 | 0xffc0 SOF0 | 17
+ 177 | 0xffc4 DHT | 28
+ 207 | 0xffc4 DHT | 74
+ 283 | 0xffc4 DHT | 28
+ 313 | 0xffc4 DHT | 57
+ 372 | 0xffe1 APP1 | 4613 | http://ns.adobe.com/xap/1.0/.<?x
+ 4987 | 0xffe1 APP1 | 4602 | http://ns.adobe.com/xap/1.0/.<?x
+ 9591 | 0xffda SOS
+STRUCTURE OF JPEG FILE: girl.jpg
+ address | marker | length | data
+ 0 | 0xffd8 SOI
+ 2 | 0xffe0 APP0 | 16 | JFIF............
+ 20 | 0xffe1 APP1 | 5704 | Exif..II*......................
+ 5726 | 0xffe1 APP1 | 5287 | http://ns.adobe.com/xap/1.0/.<?x
+ 11015 | 0xffed APP13 | 788 | Photoshop 3.0.8BIM..........Z...
+ 11805 | 0xffdb DQT | 67
+ 11874 | 0xffdb DQT | 67
+ 11943 | 0xffc0 SOF0 | 17
+ 11962 | 0xffc4 DHT | 28
+ 11992 | 0xffc4 DHT | 74
+ 12068 | 0xffc4 DHT | 28
+ 12098 | 0xffc4 DHT | 57
+ 12157 | 0xffe1 APP1 | 4602 | http://ns.adobe.com/xap/1.0/.<?x
+ 16761 | 0xffda SOS
+STRUCTURE OF JPEG FILE: girl.jpg
+ address | marker | length | data
+ 0 | 0xffd8 SOI
+ 2 | 0xffe0 APP0 | 16 | JFIF............
+ 20 | 0xffdb DQT | 67
+ 89 | 0xffdb DQT | 67
+ 158 | 0xffc0 SOF0 | 17
+ 177 | 0xffc4 DHT | 28
+ 207 | 0xffc4 DHT | 74
+ 283 | 0xffc4 DHT | 28
+ 313 | 0xffc4 DHT | 57
+ 372 | 0xffe1 APP1 | 4613 | http://ns.adobe.com/xap/1.0/.<?x
+ 4987 | 0xffe1 APP1 | 4602 | http://ns.adobe.com/xap/1.0/.<?x
+ 9591 | 0xffda SOS
+STRUCTURE OF JPEG FILE: girl.jpg
+ address | marker | length | data
+ 0 | 0xffd8 SOI
+ 2 | 0xffe0 APP0 | 16 | JFIF............
+ 20 | 0xffe1 APP1 | 4552 | Exif..II*......................
+ 4574 | 0xffe1 APP1 | 4692 | http://ns.adobe.com/xap/1.0/.<?x
+ 9268 | 0xffed APP13 | 788 | Photoshop 3.0.8BIM..........Z...
+ 10058 | 0xffdb DQT | 67
+ 10127 | 0xffdb DQT | 67
+ 10196 | 0xffc0 SOF0 | 17
+ 10215 | 0xffc4 DHT | 28
+ 10245 | 0xffc4 DHT | 74
+ 10321 | 0xffc4 DHT | 28
+ 10351 | 0xffc4 DHT | 57
+ 10410 | 0xffe1 APP1 | 4602 | http://ns.adobe.com/xap/1.0/.<?x
+ 15014 | 0xffda SOS
+STRUCTURE OF JPEG FILE: girl.jpg
+ address | marker | length | data
+ 0 | 0xffd8 SOI
+ 2 | 0xffe0 APP0 | 16 | JFIF............
+ 20 | 0xffdb DQT | 67
+ 89 | 0xffdb DQT | 67
+ 158 | 0xffc0 SOF0 | 17
+ 177 | 0xffc4 DHT | 28
+ 207 | 0xffc4 DHT | 74
+ 283 | 0xffc4 DHT | 28
+ 313 | 0xffc4 DHT | 57
+ 372 | 0xffe1 APP1 | 4613 | http://ns.adobe.com/xap/1.0/.<?x
+ 4987 | 0xffe1 APP1 | 4602 | http://ns.adobe.com/xap/1.0/.<?x
+ 9591 | 0xffda SOS
+Warning: Exif tag Exif.Image.InterColorProfile not encoded
+STRUCTURE OF JPEG FILE: girl.jpg
+ address | marker | length | data
+ 0 | 0xffd8 SOI
+ 2 | 0xffe0 APP0 | 16 | JFIF............
+ 20 | 0xffe1 APP1 | 1880 | Exif..II*......................
+ 1902 | 0xffe1 APP1 | 6767 | http://ns.adobe.com/xap/1.0/.<?x
+ 8671 | 0xffed APP13 | 794 | Photoshop 3.0.8BIM..........Z...
+ 9467 | 0xffdb DQT | 67
+ 9536 | 0xffdb DQT | 67
+ 9605 | 0xffc0 SOF0 | 17
+ 9624 | 0xffc4 DHT | 28
+ 9654 | 0xffc4 DHT | 74
+ 9730 | 0xffc4 DHT | 28
+ 9760 | 0xffc4 DHT | 57
+ 9819 | 0xffe1 APP1 | 4602 | http://ns.adobe.com/xap/1.0/.<?x
+ 14423 | 0xffda SOS
+STRUCTURE OF JPEG FILE: girl.jpg
+ address | marker | length | data
+ 0 | 0xffd8 SOI
+ 2 | 0xffe0 APP0 | 16 | JFIF............
+ 20 | 0xffdb DQT | 67
+ 89 | 0xffdb DQT | 67
+ 158 | 0xffc0 SOF0 | 17
+ 177 | 0xffc4 DHT | 28
+ 207 | 0xffc4 DHT | 74
+ 283 | 0xffc4 DHT | 28
+ 313 | 0xffc4 DHT | 57
+ 372 | 0xffe1 APP1 | 4613 | http://ns.adobe.com/xap/1.0/.<?x
+ 4987 | 0xffe1 APP1 | 4602 | http://ns.adobe.com/xap/1.0/.<?x
+ 9591 | 0xffda SOS
+STRUCTURE OF JPEG FILE: girl.jpg
+ address | marker | length | data
+ 0 | 0xffd8 SOI
+ 2 | 0xffe0 APP0 | 16 | JFIF............
+ 20 | 0xffe1 APP1 | 8528 | Exif..II*......................
+ 8550 | 0xffe1 APP1 | 6730 | http://ns.adobe.com/xap/1.0/.<?x
+ 15282 | 0xffed APP13 | 794 | Photoshop 3.0.8BIM..........Z...
+ 16078 | 0xffdb DQT | 67
+ 16147 | 0xffdb DQT | 67
+ 16216 | 0xffc0 SOF0 | 17
+ 16235 | 0xffc4 DHT | 28
+ 16265 | 0xffc4 DHT | 74
+ 16341 | 0xffc4 DHT | 28
+ 16371 | 0xffc4 DHT | 57
+ 16430 | 0xffe1 APP1 | 4602 | http://ns.adobe.com/xap/1.0/.<?x
+ 21034 | 0xffda SOS
+STRUCTURE OF JPEG FILE: Reagan.jpg
+ address | marker | length | data
+ 0 | 0xffd8 SOI
+ 2 | 0xffe1 APP1 | 5704 | Exif..MM.*......................
+ 5708 | 0xffe1 APP1 | 5287 | http://ns.adobe.com/xap/1.0/.<?x
+ 10997 | 0xffe2 APP2 | 65512 | ICC_PROFILE...... APPL....prtrRG chunk 1/25
+ 76513 | 0xffe2 APP2 | 65512 | ICC_PROFILE...X..Ih.V...j.U..4mV chunk 2/25
+ 142029 | 0xffe2 APP2 | 65512 | ICC_PROFILE...}.f...~mcx....`... chunk 3/25
+ 207545 | 0xffe2 APP2 | 65512 | ICC_PROFILE....|...S...^...v.... chunk 4/25
+ 273061 | 0xffe2 APP2 | 65512 | ICC_PROFILE.....bXf2..`Og...^0g. chunk 5/25
+ 338577 | 0xffe2 APP2 | 65512 | ICC_PROFILE.....~.|...{.}P..y.}. chunk 6/25
+ 404093 | 0xffe2 APP2 | 65512 | ICC_PROFILE......b.....:...?.... chunk 7/25
+ 469609 | 0xffe2 APP2 | 65512 | ICC_PROFILE...Q8yq].R.wW].S.uJ]e chunk 8/25
+ 535125 | 0xffe2 APP2 | 65512 | ICC_PROFILE...i.T'..RA.Y..P,.... chunk 9/25
+ 600641 | 0xffe2 APP2 | 65512 | ICC_PROFILE...i.}/..key...l.v..c chunk 10/25
+ 666157 | 0xffe2 APP2 | 65512 | ICC_PROFILE...{....O{.....|..c.. chunk 11/25
+ 731673 | 0xffe2 APP2 | 65512 | ICC_PROFILE...E.;.O-F.-.R>J...a. chunk 12/25
+ 797189 | 0xffe2 APP2 | 65512 | ICC_PROFILE....X..up............ chunk 13/25
+ 862705 | 0xffe2 APP2 | 65512 | ICC_PROFILE........<............ chunk 14/25
+ 928221 | 0xffe2 APP2 | 65512 | ICC_PROFILE..............,...'.. chunk 15/25
+ 993737 | 0xffe2 APP2 | 65512 | ICC_PROFILE.......g.....m%....qw chunk 16/25
+ 1059253 | 0xffe2 APP2 | 65512 | ICC_PROFILE......s....xX.M..n... chunk 17/25
+ 1124769 | 0xffe2 APP2 | 65512 | ICC_PROFILE............0......E. chunk 18/25
+ 1190285 | 0xffe2 APP2 | 65512 | ICC_PROFILE........(.n.B........ chunk 19/25
+ 1255801 | 0xffe2 APP2 | 65512 | ICC_PROFILE...0.0.282.0.282.0.28 chunk 20/25
+ 1321317 | 0xffe2 APP2 | 65512 | ICC_PROFILE...175.0.176.0.175.0. chunk 21/25
+ 1386833 | 0xffe2 APP2 | 65512 | ICC_PROFILE...103.0.114.0.126.0. chunk 22/25
+ 1452349 | 0xffe2 APP2 | 65512 | ICC_PROFILE...6.0.049.0.053.0.05 chunk 23/25
+ 1517865 | 0xffe2 APP2 | 65512 | ICC_PROFILE....0.670.0.653.0.634 chunk 24/25
+ 1583381 | 0xffe2 APP2 | 41712 | ICC_PROFILE...09.0.584.0.555.0.5 chunk 25/25
+ 1625097 | 0xffed APP13 | 3030 | Photoshop 3.0.8BIM..........Z...
+ 1628129 | 0xffee APP14 | 14 | Adobe.d at ......
+ 1628145 | 0xffdb DQT | 132
+ 1628279 | 0xffc0 SOF0 | 17
+ 1628298 | 0xffdd DRI | 4
+ 1628304 | 0xffc4 DHT | 418
+ 1628724 | 0xffda SOS
+STRUCTURE OF TIFF FILE (MM): Reagan.tiff
+ address | tag | type | count | offset | value
+ 10 | 0x0100 ImageWidth | SHORT | 1 | 13107200 | 200
+ 22 | 0x0101 ImageLength | SHORT | 1 | 8519680 | 130
+ 34 | 0x0102 BitsPerSample | SHORT | 4 | 338 | 8 8 8 8
+ 46 | 0x0103 Compression | SHORT | 1 | 65536 | 1
+ 58 | 0x0106 PhotometricInterpretation | SHORT | 1 | 131072 | 2
+ 70 | 0x010e ImageDescription | ASCII | 403 | 346 | 040621-N-6536T-062.USS Ronald Re ...
+ 82 | 0x010f Make | ASCII | 18 | 750 | NIKON CORPORATION
+ 94 | 0x0110 Model | ASCII | 10 | 768 | NIKON D1X
+ 106 | 0x0111 StripOffsets | LONG | 1 | 1620922 | 1620922
+ 118 | 0x0112 Orientation | SHORT | 1 | 65536 | 1
+ 130 | 0x0115 SamplesPerPixel | SHORT | 1 | 262144 | 4
+ 142 | 0x0116 RowsPerStrip | SHORT | 1 | 8519680 | 130
+ 154 | 0x0117 StripByteCounts | LONG | 1 | 104000 | 104000
+ 166 | 0x011a XResolution | RATIONAL | 1 | 778 | 778/0
+ 178 | 0x011b YResolution | RATIONAL | 1 | 786 | 786/0
+ 190 | 0x011c PlanarConfiguration | SHORT | 1 | 65536 | 1
+ 202 | 0x0128 ResolutionUnit | SHORT | 1 | 131072 | 2
+ 214 | 0x0131 Software | ASCII | 29 | 794 | Adobe Photoshop CS Macintosh
+ 226 | 0x0132 DateTime | ASCII | 20 | 824 | 2012:04:07 16:11:27
+ 238 | 0x013b Artist | ASCII | 34 | 844 | Photographer..s Mate 3rd Class ( ...
+ 250 | 0x0152 ExtraSamples | SHORT | 1 | 65536 | 1
+ 262 | 0x0153 SampleFormat | SHORT | 4 | 878 | 1 1 1 1
+ 274 | 0x02bc XMLPacket | BYTE | 4917 | 886 | <?xpacket begin="..." id="W5M0Mp ...
+ 286 | 0x83bb IPTCNAA | LONG | 233 | 5804 | 469850624 52110663 469893120 33554972 39125013 ...
+ 298 | 0x8769 ExifTag | LONG | 1 | 1620336 | 1620336
+ 310 | 0x8773 InterColorProfile | UNDEFINED | 1613600 | 6736 | ... APPL....prtrRGB Lab ........ ...
+ 322 | 0x8825 GPSTag | LONG | 1 | 1620904 | 1620904
+END Reagan.tiff
+STRUCTURE OF PNG FILE: ReaganSmallPng.png
+ address | chunk | length | data | checksum
+ 8 | IHDR | 13 | ............ | 0x8cf910c3
+ 33 | zTXt | 8648 | Raw profile type exif..x...Wv$ | 0xca41f34d
+ 8693 | zTXt | 632 | Raw profile type iptc..x..T[.. | 0xa2860459
+ 9337 | iCCP | 1159185 | ICC PROFILE..x...uP.[..9 at .HB.D | 0x4a90a7d7
+ 1168534 | iTXt | 7117 | XML:com.adobe.xmp.....<?xpacke | 0x2ff025b8
+ 1175663 | gAMA | 4 | .... | 0x0bfc6105
+ 1175679 | bKGD | 6 | ...... | 0xa0bda793
+ 1175697 | pHYs | 9 | ...#...#. | 0x78a53f76
+ 1175718 | tIME | 7 | ......# | 0xdf7f5bbd
+ 1175737 | zTXt | 278 | Comment..x.}..n. at ....O..5..h.. | 0xdb1dfff5
+ 1176027 | IDAT | 8192 | x...i.$.u%v....Gdd...U..X.`0.9 | 0x96dc2ed9
+ 1184231 | IDAT | 8192 | df.."..1L...0...j....`F.&.yf.. | 0xbfeb3575
+ 1192435 | IDAT | 8192 | K-N.t.ENL.R..q](jm...sN..U.+.. | 0xe249a922
+ 1200639 | IDAT | 8192 | >..?.Nw..iN......xE....z..[..} | 0x054b9d1e
+ 1208843 | IDAT | 7066 | ...q.B...2*@..#....T....h..v.. | 0x327f1e3e
+ 1215921 | IEND | 0 | | 0xae426082
+STRUCTURE OF WEBP FILE: exiv2-bug1199.webp
+ Chunk | Length | Offset | Payload
+ RIFF | 1800566 | 0 | WEBP
+ VP8X | 10 | 12 | ,........
+ ICCP | 1613600 | 30 | ... APPL....prtrRGB Lab ........
+ VP8 | 172008 | 1613638 | .G...*.. .>1..B.!..o.. ......]..
+ EXIF | 12040 | 1785654 | II*........................... .
+ XMP | 2864 | 1797702 | <?xpacket begin="..." id="W5M0Mp
diff --git a/test/stdin-test.sh b/test/stdin-test.sh
index 05d77e2..e715caf 100755
--- a/test/stdin-test.sh
+++ b/test/stdin-test.sh
@@ -22,10 +22,27 @@ source ./functions.source
runTest exiv2 -pX exiv2-bug1229.jpg | runTest exiv2 -iXX- girl.jpg
runTest exiv2 -pS girl.jpg
- for f in Reagan.tiff Reagan.tiff ReaganSmallPng.png; do
+ for f in Reagan.jpg Reagan.tiff ReaganSmallPng.png; do
copyTestFile $f
runTest exiv2 -pX exiv2-bug1229.jpg | runTest exiv2 -iXX- $f
- exiv2 -pX $f | xmllint --format -
+ runTest exiv2 -pX $f | xmllint --format -
+ done
+
+ printf "a (exiv2, xmp, iptc) " >&3
+ for f in Reagan.jpg Reagan.tiff ReaganLargeTiff.tiff ReaganSmallPng.png; do
+ copyTestFile $f
+ copyTestFile exiv2-bug1229.jpg girl.jpg
+ runTest exiv2 -pS girl.jpg
+ runTest exiv2 -ea- $f | runTest exiv2 -ia- girl.jpg
+ runTest exiv2 -pS girl.jpg
+ done
+
+ printf "ICC " >&3
+ copyTestFile ReaganLargeTiff.tiff
+ for f in Reagan.jpg Reagan.tiff ReaganSmallPng.png exiv2-bug1199.webp ; do
+ copyTestFile $f
+ runTest exiv2 -eC- ReaganLargeTiff.tiff | runTest exiv2 -iC- $f
+ runTest exiv2 -pS $f
done
) 3>&1 > $results 2>&1
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list