[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:12 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=774f960
The following commit has been merged in the master branch:
commit 774f96094c477f2a6f402122fba83305eef6faf9
Author: Robin Mills <robin at clanmills.com>
Date: Sat Oct 15 08:51:19 2016 +0000
#1243 Work-in-progress on iccProfile related code.
---
include/exiv2/jp2image.hpp | 3 +--
src/jp2image.cpp | 36 ++++++++++++++----------------------
2 files changed, 15 insertions(+), 24 deletions(-)
diff --git a/include/exiv2/jp2image.hpp b/include/exiv2/jp2image.hpp
index 1aba2b7..3df0448 100644
--- a/include/exiv2/jp2image.hpp
+++ b/include/exiv2/jp2image.hpp
@@ -120,9 +120,8 @@ namespace Exiv2
@brief reformats the Jp2Header to store iccProfile
@param oldData DataBufRef to data in the file.
@param newData DataBufRef with updated data
- @return length of box (including the 8 bytes of the box)
*/
- uint32_t encodeJp2Header(const DataBuf& oldData,DataBuf& newData);
+ void encodeJp2Header(const DataBuf& oldData,DataBuf& newData);
//@}
}; // class Jp2Image
diff --git a/src/jp2image.cpp b/src/jp2image.cpp
index 7111120..4e56072 100644
--- a/src/jp2image.cpp
+++ b/src/jp2image.cpp
@@ -596,33 +596,25 @@ namespace Exiv2
} // Jp2Image::writeMetadata
- uint32_t Jp2Image::encodeJp2Header(const DataBuf& boxBuf,DataBuf& newBuf)
+ void Jp2Image::encodeJp2Header(const DataBuf& boxBuf,DataBuf& newBuf)
{
- long result = boxBuf.size_;
newBuf.alloc(boxBuf.size_);
::memcpy(newBuf.pData_,boxBuf.pData_,boxBuf.size_);
+
#ifdef DEBUG
- Jp2BoxHeader& box= (Jp2BoxHeader&) *(Jp2BoxHeader*) boxBuf.pData_;
- int32_t length = getLong((byte*)&box.length, bigEndian);
-
- uint32_t count = sizeof (Jp2BoxHeader);
- char* p = (char*) boxBuf.pData_+sizeof(Jp2BoxHeader);
-
- bool done = false;
- while ( !done ) {
- Jp2BoxHeader& subBox = (Jp2BoxHeader&) *((Jp2BoxHeader*)p) ;
-
- subBox.length = getLong((byte*)&subBox.length, bigEndian);
- subBox.type = getLong((byte*)&subBox.type, bigEndian);
- done = subBox.length < sizeof(subBox) || subBox.type == kJp2BoxTypeClose || count >= length;
- if ( !done ) {
- std::cout << "subbox: "<< toAscii(subBox.type) << " length = " << subBox.length << std::endl;
- p += subBox.length ;
- count += subBox.length;
- }
+ Jp2BoxHeader* pBox = (Jp2BoxHeader*) boxBuf.pData_;
+ int32_t length = getLong((byte*)&pBox->length, bigEndian);
+ uint32_t count = sizeof (Jp2BoxHeader);
+ char* p = (char*) boxBuf.pData_;
+ while ( count < length ) {
+ Jp2BoxHeader* pSubBox = (Jp2BoxHeader*) (p+count) ;
+
+ pSubBox->length = getLong((byte*)&pSubBox->length, bigEndian);
+ pSubBox->type = getLong((byte*)&pSubBox->type, bigEndian);
+ std::cout << "subbox: "<< toAscii(pSubBox->type) << " length = " << pSubBox->length << std::endl;
+ count += pSubBox->length;
}
#endif
- return (uint32_t) result ;
}
void Jp2Image::doWriteMetadata(BasicIo& outIo)
@@ -716,7 +708,7 @@ namespace Exiv2
{
case kJp2BoxTypeJp2Header:
{
- DataBuf newBuf ;
+ DataBuf newBuf;
encodeJp2Header(boxBuf,newBuf);
#ifdef DEBUG
std::cout << "Exiv2::Jp2Image::doWriteMetadata: Write JP2Header box (length: " << box.length << ")" << std::endl;
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list