head 1.3; access; symbols pkgsrc-2023Q2:1.1.0.28 pkgsrc-2023Q2-base:1.1 pkgsrc-2023Q1:1.1.0.26 pkgsrc-2023Q1-base:1.1 pkgsrc-2022Q4:1.1.0.24 pkgsrc-2022Q4-base:1.1 pkgsrc-2022Q3:1.1.0.22 pkgsrc-2022Q3-base:1.1 pkgsrc-2022Q2:1.1.0.20 pkgsrc-2022Q2-base:1.1 pkgsrc-2022Q1:1.1.0.18 pkgsrc-2022Q1-base:1.1 pkgsrc-2021Q4:1.1.0.16 pkgsrc-2021Q4-base:1.1 pkgsrc-2021Q3:1.1.0.14 pkgsrc-2021Q3-base:1.1 pkgsrc-2021Q2:1.1.0.12 pkgsrc-2021Q2-base:1.1 pkgsrc-2021Q1:1.1.0.10 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.8 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.6 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.4 pkgsrc-2020Q2-base:1.1 pkgsrc-2020Q1:1.1.0.2 pkgsrc-2020Q1-base:1.1; locks; strict; comment @// @; 1.3 date 2023.09.24.09.15.08; author wiz; state dead; branches; next 1.2; commitid ygQsakDzg6bLh0GE; 1.2 date 2023.07.13.09.31.07; author wiz; state Exp; branches; next 1.1; commitid 4lb6xT67OXuGICwE; 1.1 date 2020.03.20.20.46.04; author joerg; state Exp; branches; next ; commitid MaovUvSHNKIFlb1C; desc @@ 1.3 log @gipfel: update to 0.4.1. gipfel-0.4.1 * fix compilation with newer Exiv2 library * fix compilation on NetBSD - by Thomas Klausner @ text @$NetBSD: patch-src_ImageMetaData.cxx,v 1.2 2023/07/13 09:31:07 wiz Exp $ Fix build with exiv2 0.28.0 --- src/ImageMetaData.cxx.orig 2010-03-11 12:36:30.000000000 +0000 +++ src/ImageMetaData.cxx @@@@ -19,6 +19,8 @@@@ #include #include +#include +#include #include "../config.h" #include "ImageMetaData.H" @@@@ -102,12 +104,16 @@@@ exifSetCoordinate(double *destVal, Exiv2 int ImageMetaData::load_image_exif(char *name) { +#if EXIV2_TEST_VERSION(0,28,0) + Exiv2::Image::UniquePtr image; +#else Exiv2::Image::AutoPtr image; +#endif try { image = Exiv2::ImageFactory::open(name); image->readMetadata(); - } catch (Exiv2::Error error) { + } catch (Exiv2::Error &error) { fprintf(stderr, "Error reading metadata\n"); return 1; } @@@@ -134,19 +140,19 @@@@ ImageMetaData::load_image_exif(char *nam _model = strdup(pos->toString().c_str()); } - if (isnan(_focal_length)) + if (std::isnan(_focal_length)) exifSetValue(&_focal_length, &exifData, "Exif.Photo.FocalLength"); - if (isnan(_focal_length_35mm)) + if (std::isnan(_focal_length_35mm)) exifSetValue(&_focal_length_35mm, &exifData, "Exif.Photo.FocalLengthIn35mmFilm"); - if (isnan(_longitude)) + if (std::isnan(_longitude)) exifSetCoordinate(&_longitude, &exifData, "Exif.GPSInfo.GPSLongitude"); - if (isnan(_latitude)) + if (std::isnan(_latitude)) exifSetCoordinate(&_latitude, &exifData, "Exif.GPSInfo.GPSLatitude"); - if (isnan(_height)) + if (std::isnan(_height)) exifSetValue(&_height, &exifData, "Exif.GPSInfo.GPSAltitude"); return 0; @@@@ -170,12 +176,16 @@@@ ImageMetaData::load_image_jpgcom(char *n double lo, la, he, dir, ni, ti, fr, k0, k1, x0 = 0.0; int pt = 0; int n, ret = 1; +#if EXIV2_TEST_VERSION(0,28,0) + Exiv2::Image::UniquePtr image; +#else Exiv2::Image::AutoPtr image; +#endif try { image = Exiv2::ImageFactory::open(name); image->readMetadata(); - } catch (Exiv2::Error error) { + } catch (Exiv2::Error &error) { fprintf(stderr, "Error reading metadata\n"); return 1; } @@@@ -245,7 +255,11 @@@@ ImageMetaData::save_image_jpgcom(char *i close(in_fd); +#if EXIV2_TEST_VERSION(0,28,0) + Exiv2::Image::UniquePtr image = Exiv2::ImageFactory::open(tmpname); +#else Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(tmpname); +#endif if (!image.get()) err++; @@@@ -267,7 +281,7 @@@@ ImageMetaData::save_image_jpgcom(char *i try { image->writeMetadata(); - } catch (Exiv2::Error error) { + } catch (Exiv2::Error &error) { fprintf(stderr, "Error writing metadata\n"); err++; } @ 1.2 log @gipfel: fix build with exiv2 0.28.0 Patch mailed upstream. @ text @d1 1 a1 1 $NetBSD: patch-src_ImageMetaData.cxx,v 1.1 2020/03/20 20:46:04 joerg Exp $ @ 1.1 log @Fix exif2 fallout. @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 1 --- src/ImageMetaData.cxx.orig 2020-03-20 19:11:56.000675904 +0000 d7 1 a7 1 @@@@ -19,6 +19,7 @@@@ d12 1 d16 82 @