[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:09 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=0798b95
The following commit has been merged in the master branch:
commit 0798b95b508adc3e358332c3b5af23efe9d3a2f0
Author: Robin Mills <robin at clanmills.com>
Date: Mon Dec 28 21:21:08 2015 +0000
#1143. Partial solution. I have suppressed the warning and allocated memory for Exif.Sony1.Preview. So now the size is revealed to the user. However: for reasons documented in the code, I am unable to locate the image in the source file and copy it into the metadata.
---
src/tiffvisitor.cpp | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp
index c3e3119..fb9de36 100644
--- a/src/tiffvisitor.cpp
+++ b/src/tiffvisitor.cpp
@@ -1489,12 +1489,17 @@ namespace Exiv2 {
return;
}
p += 4;
+ uint32_t isize= 0; // size of Exif.Sony1.PreviewImage
uint32_t size = typeSize * count;
int32_t offset = getLong(p, byteOrder());
byte* pData = p;
if ( size > 4
&& ( baseOffset() + offset >= size_
|| static_cast<int32_t>(baseOffset()) + offset <= 0)) {
+ // #1143
+ if ( object->tag() == 0x2001 && std::string(groupName(object->group())) == "Sony1" ) {
+ isize=size;
+ } else {
#ifndef SUPPRESS_WARNINGS
EXV_ERROR << "Offset of directory " << groupName(object->group())
<< ", entry 0x" << std::setw(4)
@@ -1504,6 +1509,7 @@ namespace Exiv2 {
<< std::setfill('0') << std::hex << offset
<< "; truncating the entry
";
#endif
+ }
size = 0;
}
if (size > 4) {
@@ -1528,7 +1534,17 @@ namespace Exiv2 {
}
Value::AutoPtr v = Value::create(typeId);
assert(v.get());
- v->read(pData, size, byteOrder());
+ if ( !isize ) {
+ v->read(pData, size, byteOrder());
+ } else {
+ // #1143 Write a "hollow" buffer for the preview image
+ // Sadly: we don't know the exact location of the image in the source (it's near offset)
+ // And neither TiffReader nor TiffEntryBase have access to the BasicIo object being processed
+ byte* buffer = (byte*) ::malloc(isize);
+ ::memset(buffer,isize,0);
+ v->read(buffer,isize, byteOrder());
+ ::free(buffer);
+ }
object->setValue(v);
object->setData(pData, size);
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list