60 lines
1.9 KiB
Text
60 lines
1.9 KiB
Text
$NetBSD: patch-aa,v 1.2 2012/11/16 00:52:14 joerg Exp $
|
|
|
|
--- libkexiv2/libkexiv2/kexiv2.cpp.orig 2009-02-27 08:39:37.000000000 +0000
|
|
+++ libkexiv2/libkexiv2/kexiv2.cpp
|
|
@@ -49,6 +49,20 @@ extern "C"
|
|
#include "kexiv2private.h"
|
|
#include "kexiv2.h"
|
|
|
|
+#if defined(__NetBSD__) || defined(__DragonFly__)
|
|
+#include <sys/param.h>
|
|
+#endif
|
|
+
|
|
+#if (defined(__DragonFly__) && __DragonFly_version < 190000) || (defined(__NetBSD__) && __NetBSD_Version__ <= 399001700)
|
|
+static double trunc(double val)
|
|
+{
|
|
+ if (val > 0)
|
|
+ return floor(val);
|
|
+ else
|
|
+ return ceil(val);
|
|
+}
|
|
+#endif
|
|
+
|
|
namespace KExiv2Iface
|
|
{
|
|
|
|
@@ -800,8 +814,8 @@ bool KExiv2::setExifThumbnail(const QIma
|
|
QBuffer buffer(data);
|
|
buffer.open(IO_WriteOnly);
|
|
thumb.save(&buffer, "JPEG");
|
|
- Exiv2::ExifThumb thumb(d->exifMetadata);
|
|
- thumb.setJpegThumbnail((Exiv2::byte *)data.data(), data.size());
|
|
+ Exiv2::ExifThumb thumb2(d->exifMetadata);
|
|
+ thumb2.setJpegThumbnail((Exiv2::byte *)data.data(), data.size());
|
|
#else
|
|
KTempFile thumbFile(QString(), "KExiv2ExifThumbnail");
|
|
thumbFile.setAutoDelete(true);
|
|
@@ -1603,7 +1617,11 @@ QString KExiv2::getExifTagTitle(const ch
|
|
{
|
|
std::string exifkey(exifTagName);
|
|
Exiv2::ExifKey ek(exifkey);
|
|
+#if (EXIV2_TEST_VERSION(0,21,0))
|
|
+ return QString::fromLocal8Bit( ek.tagLabel().c_str() );
|
|
+#else
|
|
return QString::fromLocal8Bit( Exiv2::ExifTags::tagTitle(ek.tag(), ek.ifdId()) );
|
|
+#endif
|
|
}
|
|
catch (Exiv2::Error& e)
|
|
{
|
|
@@ -1619,7 +1637,11 @@ QString KExiv2::getExifTagDescription(co
|
|
{
|
|
std::string exifkey(exifTagName);
|
|
Exiv2::ExifKey ek(exifkey);
|
|
+#if (EXIV2_TEST_VERSION(0,21,0))
|
|
+ return QString::fromLocal8Bit( ek.tagDesc().c_str() );
|
|
+#else
|
|
return QString::fromLocal8Bit( Exiv2::ExifTags::tagDesc(ek.tag(), ek.ifdId()) );
|
|
+#endif
|
|
}
|
|
catch (Exiv2::Error& e)
|
|
{
|