[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:46:53 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=9ff2224
The following commit has been merged in the master branch:
commit 9ff2224fd70295a924dff38f05b0e1677fe86ddb
Author: Robin Mills <robin at clanmills.com>
Date: Sun Sep 11 15:31:28 2016 +0000
#1074. Rollback r4479 which has inflicted a lot harm on the test harness.
---
include/exiv2/image.hpp | 5 -----
src/image.cpp | 21 +--------------------
src/jpgimage.cpp | 16 +++++++++++++++-
src/pngimage.cpp | 34 ++--------------------------------
src/tiffimage.cpp | 15 +--------------
5 files changed, 19 insertions(+), 72 deletions(-)
diff --git a/include/exiv2/image.hpp b/include/exiv2/image.hpp
index 11d4cb4..a2ed2ed 100644
--- a/include/exiv2/image.hpp
+++ b/include/exiv2/image.hpp
@@ -234,11 +234,6 @@ namespace Exiv2 {
@param iccProfile DataBuf containing profile (binary)
*/
virtual void setIccProfile(DataBuf& iccProfile);
-
- /*!
- @brief find the iccProfile using printStructure() and call setIccProfile()
- */
- virtual void findIccProfile();
/*!
@brief Erase iccProfile. the profile is not removed from
the actual image until the writeMetadata() method is called.
diff --git a/src/image.cpp b/src/image.cpp
index 38c82b0..6fc0e4a 100644
--- a/src/image.cpp
+++ b/src/image.cpp
@@ -370,25 +370,6 @@ namespace Exiv2 {
{
return (supportedMetadata_ & metadataId) != 0;
}
-
- void Image::findIccProfile()
- {
- if (io().open() != 0) return;
-
- long restore = io().tell();
- std::stringstream binary( std::ios_base::out | std::ios_base::in | std::ios_base::binary );
- io().seek(0,Exiv2::BasicIo::beg);
- printStructure(binary,kpsIccProfile,0);
- long length = (long) binary.rdbuf()->pubseekoff(0, binary.end, binary.out);
- DataBuf iccProfile(length);
- binary.rdbuf()->pubseekoff(0, binary.beg, binary.out); // rewind
- binary.read((char*)iccProfile.pData_,iccProfile.size_);
-#if 1
- std::cerr << "findIccProfile length:" << length <<" data:"<< Internal::binaryToString(iccProfile.pData_, length > 24?24:length,0) << std::endl;
-#endif
- setIccProfile(iccProfile);
- io().seek(restore,Exiv2::BasicIo::beg);
- } // findIccProfile
AccessMode Image::checkMode(MetadataId metadataId) const
{
@@ -598,7 +579,7 @@ namespace Exiv2 {
}
return Image::AutoPtr();
} // ImageFactory::create
-
+
// *****************************************************************************
// template, inline and free functions
diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp
index fcf44c5..893f39e 100644
--- a/src/jpgimage.cpp
+++ b/src/jpgimage.cpp
@@ -533,7 +533,21 @@ namespace Exiv2 {
}
} // psBlob.size() > 0
- if ( rc==0 && foundIccData ) findIccProfile();
+ if ( rc==0 && foundIccData ) {
+ long restore = io_->tell();
+ std::stringstream binary( std::ios_base::out | std::ios_base::in | std::ios_base::binary );
+ io_->seek(0,Exiv2::BasicIo::beg);
+ printStructure(binary,kpsIccProfile,0);
+ long length = (long) binary.rdbuf()->pubseekoff(0, binary.end, binary.out);
+ DataBuf iccProfile(length);
+ binary.rdbuf()->pubseekoff(0, binary.beg, binary.out); // rewind
+ binary.read((char*)iccProfile.pData_,iccProfile.size_);
+#if DEBUG
+ std::cerr << "iccProfile length:" << length <<" data:"<< Internal::binaryToString(iccProfile.pData_, length > 24?24:length,0) << std::endl;
+#endif
+ setIccProfile(iccProfile);
+ io_->seek(restore,Exiv2::BasicIo::beg);
+ }
if (rc != 0) {
#ifndef SUPPRESS_WARNINGS
diff --git a/src/pngimage.cpp b/src/pngimage.cpp
index 2041509..bc5e9b7 100644
--- a/src/pngimage.cpp
+++ b/src/pngimage.cpp
@@ -334,18 +334,7 @@ namespace Exiv2 {
throw Error(3, "PNG");
}
clearMetadata();
- /*
- // Add icc profile to the metadata (see comments in writeMetadata())
- if ( iccProfile_.size_ == 0 ) {
- findIccProfile();
- Exiv2::ExifKey key("Exif.Image.InterColorProfile");
- if ( iccProfile_.size_ > 0 && exifData_.findKey(key) == exifData_.end() ) {
- Exiv2::DataValue value(iccProfile_.pData_,iccProfile_.size_);
- exifData_.add(key,&value);
- }
- }
- */
-
+
const long imgSize = io_->size();
DataBuf cheaderBuf(8); // Chunk header size : 4 bytes (data size) + 4 bytes (chunk type).
@@ -431,7 +420,7 @@ namespace Exiv2 {
io_->seek(dataOffset + 4 , BasicIo::cur);
if (io_->error() || io_->eof()) throw Error(14);
}
-
+
} // PngImage::readMetadata
void PngImage::writeMetadata()
@@ -466,14 +455,6 @@ namespace Exiv2 {
if (io_->error() || io_->eof()) throw Error(20);
throw Error(22);
}
-
- // remove the ICC profile from the exifData because it's only "parked"
- // we should not store ICC profiles in the ExifData
- // PNG use an ICCP segment.
- Exiv2::ExifKey key("Exif.Image.InterColorProfile");
- Exiv2::ExifData::iterator pos = exifData_.findKey(key);
- if ( pos != exifData_.end() ) exifData_.erase(pos);
-
// Write PNG Signature.
if (outIo.write(pngSignature, 8) != 8) throw Error(21);
@@ -529,17 +510,6 @@ namespace Exiv2 {
}
}
- if ( iccProfile_.size_ > 0 )
- {
- // Update Comment data to a new PNG chunk
- //std::string chunk = PngChunk::makeMetadataChunk(comment_, mdComment);
- //if (outIo.write((const byte*)chunk.data(), static_cast<long>(chunk.size())) != (long)chunk.size())
- //{
- // throw Error(21);
- //}
- std::cout << "found an ICC profile" << std::endl;
- }
-
if (exifData_.count() > 0)
{
// Update Exif data to a new PNG chunk
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
index f00cf71..b98693b 100644
--- a/src/tiffimage.cpp
+++ b/src/tiffimage.cpp
@@ -218,19 +218,6 @@ namespace Exiv2 {
bo = littleEndian;
}
setByteOrder(bo);
-
- // fixup ICC profile
- Exiv2::ExifKey key("Exif.Image.InterColorProfile");
- Exiv2::ExifData::iterator pos = exifData_.findKey(key);
- bool found = pos != exifData_.end();
- if ( iccProfile_.size_ > 0 ) {
- Exiv2::DataValue value(iccProfile_.pData_,iccProfile_.size_);
- if ( found ) pos->setValue(&value);
- else exifData_.add(key,&value);
- } else {
- if ( found ) exifData_.erase(pos);
- }
-
TiffParser::encode(*io_, pData, size, bo, exifData_, iptcData_, xmpData_); // may throw
} // TiffImage::writeMetadata
@@ -2516,7 +2503,7 @@ namespace Exiv2 {
{ 0x0214, ifd0Id }, // Exif.Image.ReferenceBlackWhite
{ 0x828d, ifd0Id }, // Exif.Image.CFARepeatPatternDim
{ 0x828e, ifd0Id }, // Exif.Image.CFAPattern
- // { 0x8773, ifd0Id }, // Exif.Image.InterColorProfile
+ { 0x8773, ifd0Id }, // Exif.Image.InterColorProfile
{ 0x8824, ifd0Id }, // Exif.Image.SpectralSensitivity
{ 0x8828, ifd0Id }, // Exif.Image.OECF
{ 0x9102, ifd0Id }, // Exif.Image.CompressedBitsPerPixel
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list