head 1.2; access; symbols pkgsrc-2026Q1:1.2.0.32 pkgsrc-2026Q1-base:1.2 pkgsrc-2025Q4:1.2.0.30 pkgsrc-2025Q4-base:1.2 pkgsrc-2025Q3:1.2.0.28 pkgsrc-2025Q3-base:1.2 pkgsrc-2025Q2:1.2.0.26 pkgsrc-2025Q2-base:1.2 pkgsrc-2025Q1:1.2.0.24 pkgsrc-2025Q1-base:1.2 pkgsrc-2024Q4:1.2.0.22 pkgsrc-2024Q4-base:1.2 pkgsrc-2024Q3:1.2.0.20 pkgsrc-2024Q3-base:1.2 pkgsrc-2024Q2:1.2.0.18 pkgsrc-2024Q2-base:1.2 pkgsrc-2024Q1:1.2.0.16 pkgsrc-2024Q1-base:1.2 pkgsrc-2023Q4:1.2.0.14 pkgsrc-2023Q4-base:1.2 pkgsrc-2023Q3:1.2.0.12 pkgsrc-2023Q3-base:1.2 pkgsrc-2023Q2:1.2.0.10 pkgsrc-2023Q2-base:1.2 pkgsrc-2023Q1:1.2.0.8 pkgsrc-2023Q1-base:1.2 pkgsrc-2022Q4:1.2.0.6 pkgsrc-2022Q4-base:1.2 pkgsrc-2022Q3:1.2.0.4 pkgsrc-2022Q3-base:1.2 pkgsrc-2022Q2:1.2.0.2 pkgsrc-2022Q2-base:1.2 pkgsrc-2022Q1:1.1.0.16 pkgsrc-2022Q1-base:1.1 pkgsrc-2021Q4:1.1.0.14 pkgsrc-2021Q4-base:1.1 pkgsrc-2021Q3:1.1.0.12 pkgsrc-2021Q3-base:1.1 pkgsrc-2021Q2:1.1.0.10 pkgsrc-2021Q2-base:1.1 pkgsrc-2021Q1:1.1.0.8 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.6 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.4 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.2 pkgsrc-2020Q2-base:1.1; locks; strict; comment @// @; 1.2 date 2022.05.31.11.49.09; author gdt; state Exp; branches; next 1.1; commitid ASl3jMGUaYGlAcGD; 1.1 date 2020.05.14.16.42.14; author nia; state Exp; branches; next ; commitid 3Tph3M06xg54ee8C; desc @@ 1.2 log @graphics/freeimage: Remediate upstream use of internal TIFF function freeimage uses an internal libtiff function (by declaring it and calling it). tiff (4.4.0) changed internals, but this was never part of the public API/ABI. Add patch taken from upstream forum (which seems to be their bugtracker) to use a different function newly added to the public API in 4.4.0. @ text @$NetBSD: patch-Source_Metadata_XTIFF.cpp,v 1.1 2020/05/14 16:42:14 nia Exp $ Unbundle image libraries. Remediate upstream use of a tiff internal function, which no longer exists in tiff 4.4.0. Upstream bug report (in forum; there is no issue tracker): https://sourceforge.net/p/freeimage/discussion/36109/thread/2018fdc6e7/?limit=25 --- Source/Metadata/XTIFF.cpp.orig 2015-03-04 05:07:10.000000000 +0000 +++ Source/Metadata/XTIFF.cpp @@@@ -29,7 +29,7 @@@@ #pragma warning (disable : 4786) // identifier was truncated to 'number' characters #endif -#include "../LibTIFF4/tiffiop.h" +#include #include "FreeImage.h" #include "Utilities.h" @@@@ -224,6 +224,33 @@@@ tiff_write_geotiff_profile(TIFF *tif, FI // TIFF EXIF tag reading & writing // ---------------------------------------------------------- +static uint32 exif_tag_ids[] = { + EXIFTAG_EXPOSURETIME, EXIFTAG_FNUMBER, EXIFTAG_EXPOSUREPROGRAM, + EXIFTAG_SPECTRALSENSITIVITY, EXIFTAG_ISOSPEEDRATINGS, EXIFTAG_OECF, + EXIFTAG_EXIFVERSION, EXIFTAG_DATETIMEORIGINAL, EXIFTAG_DATETIMEDIGITIZED, + EXIFTAG_COMPONENTSCONFIGURATION, EXIFTAG_COMPRESSEDBITSPERPIXEL, + EXIFTAG_SHUTTERSPEEDVALUE, EXIFTAG_APERTUREVALUE, + EXIFTAG_BRIGHTNESSVALUE, EXIFTAG_EXPOSUREBIASVALUE, + EXIFTAG_MAXAPERTUREVALUE, EXIFTAG_SUBJECTDISTANCE, EXIFTAG_METERINGMODE, + EXIFTAG_LIGHTSOURCE, EXIFTAG_FLASH, EXIFTAG_FOCALLENGTH, + EXIFTAG_SUBJECTAREA, EXIFTAG_MAKERNOTE, EXIFTAG_USERCOMMENT, + EXIFTAG_SUBSECTIME, EXIFTAG_SUBSECTIMEORIGINAL, + EXIFTAG_SUBSECTIMEDIGITIZED, EXIFTAG_FLASHPIXVERSION, EXIFTAG_COLORSPACE, + EXIFTAG_PIXELXDIMENSION, EXIFTAG_PIXELYDIMENSION, + EXIFTAG_RELATEDSOUNDFILE, EXIFTAG_FLASHENERGY, + EXIFTAG_SPATIALFREQUENCYRESPONSE, EXIFTAG_FOCALPLANEXRESOLUTION, + EXIFTAG_FOCALPLANEYRESOLUTION, EXIFTAG_FOCALPLANERESOLUTIONUNIT, + EXIFTAG_SUBJECTLOCATION, EXIFTAG_EXPOSUREINDEX, EXIFTAG_SENSINGMETHOD, + EXIFTAG_FILESOURCE, EXIFTAG_SCENETYPE, EXIFTAG_CFAPATTERN, + EXIFTAG_CUSTOMRENDERED, EXIFTAG_EXPOSUREMODE, EXIFTAG_WHITEBALANCE, + EXIFTAG_DIGITALZOOMRATIO, EXIFTAG_FOCALLENGTHIN35MMFILM, + EXIFTAG_SCENECAPTURETYPE, EXIFTAG_GAINCONTROL, EXIFTAG_CONTRAST, + EXIFTAG_SATURATION, EXIFTAG_SHARPNESS, EXIFTAG_DEVICESETTINGDESCRIPTION, + EXIFTAG_SUBJECTDISTANCERANGE, EXIFTAG_GAINCONTROL, EXIFTAG_GAINCONTROL, + EXIFTAG_IMAGEUNIQUEID +}; +static int nExifTags = sizeof(exif_tag_ids) / sizeof(exif_tag_ids[0]); + /** Read a single Exif tag @@@@ -575,45 +602,11 @@@@ tiff_read_exif_tags(TIFF *tif, TagLib::M // loop over all Core Directory Tags // ### uses private data, but there is no other way + // -> Fedora: Best we can do without private headers is to hard-code a list of known EXIF tags and read those if(md_model == TagLib::EXIF_MAIN) { - const TIFFDirectory *td = &tif->tif_dir; - - uint32 lastTag = 0; //<- used to prevent reading some tags twice (as stored in tif_fieldinfo) - - for (int fi = 0, nfi = (int)tif->tif_nfields; nfi > 0; nfi--, fi++) { - const TIFFField *fld = tif->tif_fields[fi]; - - const uint32 tag_id = TIFFFieldTag(fld); - - if(tag_id == lastTag) { - continue; - } - - // test if tag value is set - // (lifted directly from LibTiff _TIFFWriteDirectory) - - if( fld->field_bit == FIELD_CUSTOM ) { - int is_set = FALSE; - - for(int ci = 0; ci < td->td_customValueCount; ci++ ) { - is_set |= (td->td_customValues[ci].info == fld); - } - - if( !is_set ) { - continue; - } - - } else if(!TIFFFieldSet(tif, fld->field_bit)) { - continue; - } - - // process *all* other tags (some will be ignored) - - tiff_read_exif_tag(tif, tag_id, dib, md_model); - - lastTag = tag_id; + for (int i = 0; i < nExifTags; ++i) { + tiff_read_exif_tag(tif, exif_tag_ids[i], dib, md_model); } - } return TRUE; @@@@ -723,10 +716,9 @@@@ tiff_write_exif_tags(TIFF *tif, TagLib:: TagLib& tag_lib = TagLib::instance(); - for (int fi = 0, nfi = (int)tif->tif_nfields; nfi > 0; nfi--, fi++) { - const TIFFField *fld = tif->tif_fields[fi]; - - const uint32 tag_id = TIFFFieldTag(fld); + for (int fi = 0; fi < nExifTags; fi++) { + const uint32 tag_id = exif_tag_ids[fi]; + const TIFFField *fld = TIFFFieldWithTag(tif, tag_id); if(skip_write_field(tif, tag_id)) { // skip tags that are already handled by the LibTIFF writing process @@@@ -749,7 +741,7 @@@@ tiff_write_exif_tags(TIFF *tif, TagLib:: continue; } // type of storage may differ (e.g. rationnal array vs float array type) - if((unsigned)_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) { + if(TIFFFieldSetGetSize(fld) != FreeImage_TagDataWidth(tag_type)) { // skip tag or _TIFFmemcpy will fail continue; } @ 1.1 log @freeimage: Force use of unbundled libraries. Most Linux distributions have been forcing this for a while, because the reference image libraries are often full of bugs and slow to do releases, so everyone (including us) is carrying lots of local patches for security fixes. Bump PKGREVISION @ text @d1 1 a1 1 $NetBSD$ d5 5 a9 1 --- Source/Metadata/XTIFF.cpp.orig 2015-03-04 00:07:10.000000000 +0000 d11 1 a11 1 @@@@ -29,13 +29,18 @@@@ d20 1 a20 12 #include "FreeImageTag.h" #include "FIRational.h" +extern "C" +{ + int _TIFFDataSize(TIFFDataType type); +} + // ---------------------------------------------------------- // Extended TIFF Directory GEO Tag Support // ---------------------------------------------------------- @@@@ -224,6 +229,33 @@@@ tiff_write_geotiff_profile(TIFF *tif, FI d54 1 a54 1 @@@@ -575,45 +607,11 @@@@ tiff_read_exif_tags(TIFF *tif, TagLib::M d103 1 a103 1 @@@@ -723,10 +721,9 @@@@ tiff_write_exif_tags(TIFF *tif, TagLib:: d117 9 @