Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current [RISOLTO]

Se avete problemi con l'installazione e la configurazione di Slackware64 postate qui. Non usate questo forum per argomenti che trattano la Slackware32 o generali... per quelli usate rispettivamente il forum Slackware e Gnu/Linux in genere.

Moderatore: Staff

Regole del forum
1) Citare sempre la versione di Slackware64 usata, la versione del Kernel e magari anche la versione della libreria coinvolta. Questi dati aiutano le persone che possono rispondere.
2) Per evitare confusione prego inserire in questo forum solo topic che riguardano appunto Slackware64, se l'argomento è Slackware32 o generale usate rispettivamente il forum Slackware o Gnu/Linux in genere.
3) Leggere attentamente le risposte ricevute
4) Scrivere i messaggi con il colore di default, evitare altri colori.
5) Scrivere in Italiano o in Inglese, se possibile grammaticalmente corretto, evitate stili di scrittura poco chiari, quindi nessuna abbreviazione tipo telegramma o scrittura stile SMS o CHAT.
6) Appena registrati è consigliato presentarsi nel forum dedicato.

La non osservanza delle regole porta a provvedimenti di vari tipo da parte dello staff, in particolare la non osservanza della regola 5 porta alla cancellazione del post e alla segnalazione dell'utente. In caso di recidività l'utente rischia il ban temporaneo.
Rispondi
gian_d
Linux 3.x
Linux 3.x
Messaggi: 654
Iscritto il: mer 16 lug 2014, 17:35
Nome Cognome: Giancarlo Dessì
Slackware: 64 current
Kernel: 6.6.xx
Desktop: KDE 5.27
Località: Sardinia
Contatta:

Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current [RISOLTO]

Messaggio da gian_d »

OIIO è sicuramente la mia bestia nera perché ogni volta che devo compilarlo mi riserva sempre nuove e inaspettate sorprese. Di solito riesco a venirne a capo, ma questa volta non so che pesci pigliare. Apparentemente sembra che siano errori di sintassi del codice C++, cosa alquanto strana dal momento che in passato lo stesso codice veniva compilato correttamente.
Gli errori sono molteplici ma penso che siano dovuti ad un effetto a cascata di un presunto errore di sintassi iniziale. Escludendo errori del codice sorgente, probabilmente va passata qualche opzione al compilatore da cmake ma non so quale. Nello slackbuild del repository di Ponce non ci sono aggiornamenti recenti di OIIO e il pacchetto attualmente installato è stato ricompilato il 20 dicembre, quindi non dovrebbe trattarsi del compilatore.

Al che non riesco a capire se il problema deriva dal recente aggiornamento di glibc (mi è capitato con la ricompilazione di alcuni pacchetti ma per ora sono riuscito a risolverli quasi tutti) oppure da aggiornamenti di qualche pacchetto di sviluppo (cmake?) o di qualche libreria.

Metto qui una parte dello stream restituito dalla compilazione (gli errori si ripetono in modo ridondante anche per altri file *.cpp)

Codice: Seleziona tutto

Scanning dependencies of target OpenImageIO
[ 11%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/exif.cpp.o
In file included from /tmp/SBo/oiio-Release-2.0.13/src/include/OpenImageIO/tiffutils.h:45,
                 from /tmp/SBo/oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp:45:
/tmp/SBo/oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp:558:5: error: expected identifier before numeric constant
  558 |     GPSTAG_VERSIONID         = 0,
      |     ^~~~~~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp:558:5: error: expected ‘}’ before numeric constant
/tmp/SBo/oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp:557:13: note: to match this ‘{’
  557 | enum GPSTag {
      |             ^
In file included from /tmp/SBo/oiio-Release-2.0.13/src/include/OpenImageIO/tiffutils.h:45,
                 from /tmp/SBo/oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp:45:
/tmp/SBo/oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp:558:5: error: expected unqualified-id before numeric constant
  558 |     GPSTAG_VERSIONID         = 0,
      |     ^~~~~~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp:592:14: error: ‘TagInfo’ does not name a type
  592 | static const TagInfo gps_tag_table[] = {
      |              ^~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp:630:7: error: ‘TagMap’ does not name a type
  630 | const TagMap&
      |       ^~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp:639:1: error: ‘cspan’ does not name a type
  639 | cspan<TagInfo>
      | ^~~~~
/tmp/SBo/oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp:660:1: error: variable or field ‘add_exif_item_to_spec’ declared void
  660 | add_exif_item_to_spec(ImageSpec& spec, const char* name,
      | ^~~~~~~~~~~~~~~~~~~~~
/tmp/SBo/oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp:660:23: error: ‘ImageSpec’ was not declared in this scope; did you mean ‘OpenImageIO_v2_0::ImageSpec’?
  660 | add_exif_item_to_spec(ImageSpec& spec, const char* name,
      |                       ^~~~~~~~~
      |                       OpenImageIO_v2_0::ImageSpec
      
      ecc.
Qualche suggerimento?
Ultima modifica di gian_d il lun 8 feb 2021, 19:23, modificato 1 volta in totale.

gian_d
Linux 3.x
Linux 3.x
Messaggi: 654
Iscritto il: mer 16 lug 2014, 17:35
Nome Cognome: Giancarlo Dessì
Slackware: 64 current
Kernel: 6.6.xx
Desktop: KDE 5.27
Località: Sardinia
Contatta:

Re: Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current

Messaggio da gian_d »

Forse ho risolto usando lo slackbuild originale. L'avevo modificando aggiungendo -fcommon nei flag e applicando una patch per risolvere un errore che mi dava nelle precedenti compilazioni.
Adesso la compilazione sta procedendo e ha superato senza errori la fase in cui si arrestava (l'11%), speriamo che non incappi nell'errore che mi dava nelle precedenti compilazioni.

In ogni caso noto che può bastare anche un apparente banale aggiornamento delle configurazioni di sistema per far saltare fuori apparenti incasinamenti nelle compilazioni. Mah... :-D

gian_d
Linux 3.x
Linux 3.x
Messaggi: 654
Iscritto il: mer 16 lug 2014, 17:35
Nome Cognome: Giancarlo Dessì
Slackware: 64 current
Kernel: 6.6.xx
Desktop: KDE 5.27
Località: Sardinia
Contatta:

Re: Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current

Messaggio da gian_d »

Come non detto, è incappato di nuovo nell'errore nella stessa fase, solo che adesso me la dà al 19% della compilazione invece dell'11% :-\

Avatar utente
ponce
Iper Master
Iper Master
Messaggi: 3022
Iscritto il: mer 5 mar 2008, 16:45
Nome Cognome: Matteo Bernardini
Slackware: slackware64-current
Kernel: 6.6.16
Desktop: lxde
Località: Pisa
Contatta:

Re: Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current

Messaggio da ponce »

visto che l'errore sembra provenire da un header di libtiff probabilmente potrebbe essere legato all'aggiornamento di libtiff che c'e' stato in current a gennaio.

siccome openimageio e' una dipendenza di Blender e il maintainer e' lo stesso e usa anche current potresti provare a sentire se ha qualche soluzione...

gian_d
Linux 3.x
Linux 3.x
Messaggi: 654
Iscritto il: mer 16 lug 2014, 17:35
Nome Cognome: Giancarlo Dessì
Slackware: 64 current
Kernel: 6.6.xx
Desktop: KDE 5.27
Località: Sardinia
Contatta:

Re: Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current

Messaggio da gian_d »

lo farò nei prossimi giorni, prima voglio provare ancora un paio di cartucce, ma ho un po' di impegni fino a mercoledì che non mi lasciano molto tempo

gian_d
Linux 3.x
Linux 3.x
Messaggi: 654
Iscritto il: mer 16 lug 2014, 17:35
Nome Cognome: Giancarlo Dessì
Slackware: 64 current
Kernel: 6.6.xx
Desktop: KDE 5.27
Località: Sardinia
Contatta:

Re: Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current

Messaggio da gian_d »

Ponce, avevi visto giusto, il problema è causato proprio dall'aggiornamento di libtiff. Quello di gennaio era una ricompilazione, ma ho visto che è stato aggiornato dalla versione 4.1.0 a 4.2.0 proprio il 20 dicembre. Evidentemente quando avevo fatto la compilazione di OIIO il 20 dicembre non avevo ancora aggiornato i pacchetti della current.

Detto questo, ho ricompilato libtiff dai sorgenti della version 4.1.0 e fatto il downgrade sul sistema a questa versione. La compilazione di OIIO procede senza errori con lo slackbuild che avevo.

Ho già notato che nell'header tiff.h di libtiff sono state introdotte nella 4.2.0 delle definizioni che sono chiamate in causa nel codice di OIIO. Forse si tratta di un conflitto derivante da una ridondanza, voglio studiarmi i codici, magari riesco a risolvere confrontandoli con quelli dell'ultima versione di OIIO: ho visto che la compilazione di quest'ultima versione non genera questo errore ma ne incontra altri di diverso tipo.

gian_d
Linux 3.x
Linux 3.x
Messaggi: 654
Iscritto il: mer 16 lug 2014, 17:35
Nome Cognome: Giancarlo Dessì
Slackware: 64 current
Kernel: 6.6.xx
Desktop: KDE 5.27
Località: Sardinia
Contatta:

Re: Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current

Messaggio da gian_d »

Risolto, ho applicato una patch estrapolata per approssimazioni successive dal codice della versione 2.2.11 di OIIO e ora funziona. La patch non è inserita nello slackbuild originale ma in uno slackbuild ritoccato perché applico un'altra patch

Di seguito scrivo le modifiche che ho fatto

gian_d
Linux 3.x
Linux 3.x
Messaggi: 654
Iscritto il: mer 16 lug 2014, 17:35
Nome Cognome: Giancarlo Dessì
Slackware: 64 current
Kernel: 6.6.xx
Desktop: KDE 5.27
Località: Sardinia
Contatta:

Re: Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current

Messaggio da gian_d »

Slackbuild

nei flag ($SLKCFLAGS) ho aggiunto -fcommon

come patch ho aggiunto le seguenti righe

Codice: Seleziona tutto

 patch -p1 < $CWD/rawinput.diff
 patch -p1 < $CWD/oiio-libopenimageio-exif-cpp.diff
i codici delle patch li incollo in due post successivi

gian_d
Linux 3.x
Linux 3.x
Messaggi: 654
Iscritto il: mer 16 lug 2014, 17:35
Nome Cognome: Giancarlo Dessì
Slackware: 64 current
Kernel: 6.6.xx
Desktop: KDE 5.27
Località: Sardinia
Contatta:

Re: Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current

Messaggio da gian_d »

Patch rawinput.diff
Non mi ricordo il contesto, ma l'avevo applicata per risolvere degli errori in una precedente compilazione

Codice: Seleziona tutto

--- oiio-Release-2.0.13/src/raw.imageio/rawinput.cpp	2019-12-03 23:28:14.000000000 +0100
+++ oiio-Release-2.0.13-fix/src/raw.imageio/rawinput.cpp	2020-12-20 23:29:30.556780764 +0100
@@ -643,7 +643,7 @@
 #if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 17, 0)
     if (other.parsed_gps.gpsparsed) {
         add("GPS", "Latitude", other.parsed_gps.latitude, false, 0.0f);
-        add("GPS", "Longitude", other.parsed_gps.longtitude, false,
+        add("GPS", "Longitude", other.parsed_gps.longitude, false,
             0.0f);  // N.B. wrong spelling!
         add("GPS", "TimeStamp", other.parsed_gps.gpstimestamp, false, 0.0f);
         add("GPS", "Altitude", other.parsed_gps.altitude, false, 0.0f);
@@ -667,12 +667,12 @@
     // float AmbientTemperature;
     // float BatteryTemperature;
     // float exifAmbientTemperature;
-    add("Exif", "Humidity", other.exifHumidity, false, 0.0f);
-    add("Exif", "Pressure", other.exifPressure, false, 0.0f);
-    add("Exif", "WaterDepth", other.exifWaterDepth, false, 0.0f);
-    add("Exif", "Acceleration", other.exifAcceleration, false, 0.0f);
-    add("Exif", "CameraElevactionAngle", other.exifCameraElevationAngle, false,
-        0.0f);
+    //add("Exif", "Humidity", other.exifHumidity, false, 0.0f);
+    //add("Exif", "Pressure", other.exifPressure, false, 0.0f);
+    //add("Exif", "WaterDepth", other.exifWaterDepth, false, 0.0f);
+    //add("Exif", "Acceleration", other.exifAcceleration, false, 0.0f);
+    //add("Exif", "CameraElevactionAngle", other.exifCameraElevationAngle, false,
+    //    0.0f);
     // float real_ISO;
 #endif
 
@@ -861,9 +861,9 @@
 {
 #if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 18, 0)
     auto const& mn(m_processor->imgdata.makernotes.olympus);
-    MAKERF(OlympusCropID);
-    MAKERF(OlympusFrame); /* upper left XY, lower right XY */
-    MAKERF(OlympusSensorCalibration);
+    //MAKERF(OlympusCropID);
+    //MAKERF(OlympusFrame); /* upper left XY, lower right XY */
+    //MAKERF(OlympusSensorCalibration);
     MAKERF(FocusMode);
     MAKERF(AutoFocus);
     MAKERF(AFPoint);
@@ -938,12 +938,12 @@
 {
 #if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 18, 0)
     auto const& mn(m_processor->imgdata.makernotes.fuji);
-    add(m_make, "ExpoMidPointShift", mn.FujiExpoMidPointShift);
-    add(m_make, "DynamicRange", mn.FujiDynamicRange);
-    add(m_make, "FilmMode", mn.FujiFilmMode);
-    add(m_make, "DynamicRangeSetting", mn.FujiDynamicRangeSetting);
-    add(m_make, "DevelopmentDynamicRange", mn.FujiDevelopmentDynamicRange);
-    add(m_make, "AutoDynamicRange", mn.FujiAutoDynamicRange);
+    add(m_make, "ExpoMidPointShift", mn.ExpoMidPointShift);
+    add(m_make, "DynamicRange", mn.DynamicRange);
+    add(m_make, "FilmMode", mn.FilmMode);
+    add(m_make, "DynamicRangeSetting", mn.DynamicRangeSetting);
+    add(m_make, "DevelopmentDynamicRange", mn.DevelopmentDynamicRange);
+    add(m_make, "AutoDynamicRange", mn.AutoDynamicRange);
     MAKERF(FocusMode);
     MAKERF(AFMode);
     MAKERF(FocusPixel);
@@ -967,7 +967,7 @@
 {
 #if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 18, 0)
     auto const& mn(m_processor->imgdata.makernotes.sony);
-    MAKERF(SonyCameraType);
+    MAKERF(CameraType);
 #endif
 #if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0, 19, 0)
     // uchar Sony0x9400_version; /* 0 if not found/deciphered, 0xa, 0xb, 0xc following exiftool convention */
@@ -976,12 +976,12 @@
     // uchar Sony0x9400_SequenceLength1;
     // unsigned Sony0x9400_SequenceFileNumber;
     // uchar Sony0x9400_SequenceLength2;
-    if (mn.raw_crop.cwidth || mn.raw_crop.cheight) {
-        add(m_make, "cropleft", mn.raw_crop.cleft, true);
-        add(m_make, "croptop", mn.raw_crop.ctop, true);
-        add(m_make, "cropwidth", mn.raw_crop.cwidth, true);
-        add(m_make, "cropheight", mn.raw_crop.cheight, true);
-    }
+    //if (mn.raw_crop.cwidth || mn.raw_crop.cheight) {
+    //    add(m_make, "cropleft", mn.raw_crop.cleft, true);
+    //    add(m_make, "croptop", mn.raw_crop.ctop, true);
+    //    add(m_make, "cropwidth", mn.raw_crop.cwidth, true);
+    //    add(m_make, "cropheight", mn.raw_crop.cheight, true);
+    //}
     MAKERF(AFMicroAdjValue);
     MAKERF(AFMicroAdjOn);
     MAKER(AFMicroAdjRegisteredLenses, 0);
@@ -1054,17 +1054,17 @@
         MAKER(Adapter, 0);
         MAKER(AttachmentID, 0ULL);
         MAKER(Attachment, 0);
-        MAKER(CanonFocalUnits, 0);
+        MAKER(FocalUnits, 0);
         MAKER(FocalLengthIn35mmFormat, 0.0f);
     }
 
     if (Strutil::iequals(m_make, "Nikon")) {
         auto const& mn(m_processor->imgdata.lens.nikon);
-        add(m_make, "EffectiveMaxAp", mn.NikonEffectiveMaxAp);
-        add(m_make, "LensIDNumber", mn.NikonLensIDNumber);
-        add(m_make, "LensFStops", mn.NikonLensFStops);
-        add(m_make, "MCUVersion", mn.NikonMCUVersion);
-        add(m_make, "LensType", mn.NikonLensType);
+        add(m_make, "EffectiveMaxAp", mn.EffectiveMaxAp);
+        add(m_make, "LensIDNumber", mn.LensIDNumber);
+        add(m_make, "LensFStops", mn.LensFStops);
+        add(m_make, "MCUVersion", mn.MCUVersion);
+        add(m_make, "LensType", mn.LensType);
     }
     if (Strutil::iequals(m_make, "DNG")) {
         auto const& mn(m_processor->imgdata.lens.dng);

gian_d
Linux 3.x
Linux 3.x
Messaggi: 654
Iscritto il: mer 16 lug 2014, 17:35
Nome Cognome: Giancarlo Dessì
Slackware: 64 current
Kernel: 6.6.xx
Desktop: KDE 5.27
Località: Sardinia
Contatta:

Re: Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current

Messaggio da gian_d »

Patch oiio-libopenimageio-exif-cpp.diff
Questa risolve il problema dell'aggiornamento di libtiff. Peraltro in un blocco del codice aggiornato c'è anche un commento che fa riferimento proprio alle versioni di libtiff precedenti a 4.2.0

Codice: Seleziona tutto

--- oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp	2019-12-03 23:28:14.000000000 +0100
+++ oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp	2021-02-02 02:54:55.000000000 +0100
@@ -554,40 +528,44 @@
 
 
 
+// libtiff > 4.1.0 defines these in tiff.h. For older libtiff, let's define
+// them ourselves.
+#ifndef GPSTAG_VERSIONID
 enum GPSTag {
-    GPSTAG_VERSIONID         = 0,
-    GPSTAG_LATITUDEREF       = 1,
-    GPSTAG_LATITUDE          = 2,
-    GPSTAG_LONGITUDEREF      = 3,
-    GPSTAG_LONGITUDE         = 4,
-    GPSTAG_ALTITUDEREF       = 5,
-    GPSTAG_ALTITUDE          = 6,
-    GPSTAG_TIMESTAMP         = 7,
-    GPSTAG_SATELLITES        = 8,
-    GPSTAG_STATUS            = 9,
-    GPSTAG_MEASUREMODE       = 10,
-    GPSTAG_DOP               = 11,
-    GPSTAG_SPEEDREF          = 12,
-    GPSTAG_SPEED             = 13,
-    GPSTAG_TRACKREF          = 14,
-    GPSTAG_TRACK             = 15,
-    GPSTAG_IMGDIRECTIONREF   = 16,
-    GPSTAG_IMGDIRECTION      = 17,
-    GPSTAG_MAPDATUM          = 18,
-    GPSTAG_DESTLATITUDEREF   = 19,
-    GPSTAG_DESTLATITUDE      = 20,
-    GPSTAG_DESTLONGITUDEREF  = 21,
-    GPSTAG_DESTLONGITUDE     = 22,
-    GPSTAG_DESTBEARINGREF    = 23,
-    GPSTAG_DESTBEARING       = 24,
-    GPSTAG_DESTDISTANCEREF   = 25,
-    GPSTAG_DESTDISTANCE      = 26,
-    GPSTAG_PROCESSINGMETHOD  = 27,
-    GPSTAG_AREAINFORMATION   = 28,
-    GPSTAG_DATESTAMP         = 29,
-    GPSTAG_DIFFERENTIAL      = 30,
-    GPSTAG_HPOSITIONINGERROR = 31
+    GPSTAG_VERSIONID            = 0,
+    GPSTAG_LATITUDEREF          = 1,
+    GPSTAG_LATITUDE             = 2,
+    GPSTAG_LONGITUDEREF         = 3,
+    GPSTAG_LONGITUDE            = 4,
+    GPSTAG_ALTITUDEREF          = 5,
+    GPSTAG_ALTITUDE             = 6,
+    GPSTAG_TIMESTAMP            = 7,
+    GPSTAG_SATELLITES           = 8,
+    GPSTAG_STATUS               = 9,
+    GPSTAG_MEASUREMODE          = 10,
+    GPSTAG_DOP                  = 11,
+    GPSTAG_SPEEDREF             = 12,
+    GPSTAG_SPEED                = 13,
+    GPSTAG_TRACKREF             = 14,
+    GPSTAG_TRACK                = 15,
+    GPSTAG_IMGDIRECTIONREF      = 16,
+    GPSTAG_IMGDIRECTION         = 17,
+    GPSTAG_MAPDATUM             = 18,
+    GPSTAG_DESTLATITUDEREF      = 19,
+    GPSTAG_DESTLATITUDE         = 20,
+    GPSTAG_DESTLONGITUDEREF     = 21,
+    GPSTAG_DESTLONGITUDE        = 22,
+    GPSTAG_DESTBEARINGREF       = 23,
+    GPSTAG_DESTBEARING          = 24,
+    GPSTAG_DESTDISTANCEREF      = 25,
+    GPSTAG_DESTDISTANCE         = 26,
+    GPSTAG_PROCESSINGMETHOD     = 27,
+    GPSTAG_AREAINFORMATION      = 28,
+    GPSTAG_DATESTAMP            = 29,
+    GPSTAG_DIFFERENTIAL         = 30,
+    GPSTAG_GPSHPOSITIONINGERROR = 31
 };
+#endif
 
 static const TagInfo gps_tag_table[] = {
     // clang-format off
@@ -622,7 +600,7 @@
     { GPSTAG_AREAINFORMATION,	"GPS:AreaInformation",	TIFF_UNDEFINED, 1 },
     { GPSTAG_DATESTAMP,		"GPS:DateStamp",	TIFF_ASCII, 0 },
     { GPSTAG_DIFFERENTIAL,	"GPS:Differential",	TIFF_SHORT, 1 },
-    { GPSTAG_HPOSITIONINGERROR,	"GPS:HPositioningError",TIFF_RATIONAL, 1 }
+    { GPSTAG_GPSHPOSITIONINGERROR,	"GPS:HPositioningError",TIFF_RATIONAL, 1 }
     // clang-format on
 };
 
@@ -685,7 +663,7 @@
     }
     if (dirp->tdir_type == TIFF_RATIONAL) {
         int n    = dirp->tdir_count;  // How many
-        float* f = (float*)alloca(n * sizeof(float));
+        float* f = OIIO_ALLOCA(float, n);
         for (int i = 0; i < n; ++i) {
             unsigned int num, den;
             num = ((const unsigned int*)dataptr)[2 * i + 0];
@@ -704,7 +682,7 @@
     }
     if (dirp->tdir_type == TIFF_SRATIONAL) {
         int n    = dirp->tdir_count;  // How many
-        float* f = (float*)alloca(n * sizeof(float));
+        float* f = OIIO_ALLOCA(float, n);
         for (int i = 0; i < n; ++i) {
             int num, den;
             num = ((const int*)dataptr)[2 * i + 0];
@@ -799,7 +777,7 @@
 
 #if DEBUG_EXIF_READ
     std::cerr << "Read " << tagmap.mapname() << " ";
-    print_dir_entry(tagmap, dir, buf, offset_adjustment);
+    print_dir_entry(std::cerr, tagmap, dir, buf, offset_adjustment);
 #endif
 
     if (dir.tdir_tag == TIFFTAG_EXIFIFD || dir.tdir_tag == TIFFTAG_GPSIFD) {
@@ -808,7 +786,7 @@
         unsigned int offset = dirp->tdir_offset;  // int stored in offset itself
         if (swab)
             swap_endian(&offset);
-        if (offset >= buf.size()) {
+        if (offset >= size_t(buf.size())) {
 #if DEBUG_EXIF_READ
             unsigned int off2 = offset;
             swap_endian(&off2);
@@ -863,6 +841,16 @@
         unsigned int offset = dirp->tdir_offset;  // int stored in offset itself
         if (swab)
             swap_endian(&offset);
+        if (offset >= size_t(buf.size())) {
+#if DEBUG_EXIF_READ
+            unsigned int off2 = offset;
+            swap_endian(&off2);
+            std::cerr << "Bad Exif block? ExifIFD has offset " << offset
+                      << " inexplicably greater than exif buffer length "
+                      << buf.size() << " (byte swapped = " << off2 << ")\n";
+#endif
+            return;
+        }
         // Don't recurse if we've already visited this IFD
         if (ifd_offsets_seen.find(offset) != ifd_offsets_seen.end())
             return;
 
@@ -964,49 +946,46 @@
             const char* s = *(const char**)p.data();
             int len       = strlen(s) + 1;
             append_tiff_dir_entry(dirs, data, tag, type, len, s,
-                                  offset_correction);
+                                  offset_correction, 0, endianreq);
             return;
         }
         break;
     case TIFF_RATIONAL:
         if (element == TypeDesc::FLOAT) {
-            unsigned int* rat = (unsigned int*)alloca(2 * count
-                                                      * sizeof(unsigned int));
+            unsigned int* rat = OIIO_ALLOCA(unsigned int, 2 * count);
             const float* f    = (const float*)p.data();
             for (size_t i = 0; i < count; ++i)
                 float_to_rational(f[i], rat[2 * i], rat[2 * i + 1]);
             append_tiff_dir_entry(dirs, data, tag, type, count, rat,
-                                  offset_correction);
+                                  offset_correction, 0, endianreq);
             return;
         }
         break;
     case TIFF_SRATIONAL:
         if (element == TypeDesc::FLOAT) {
-            int* rat       = (int*)alloca(2 * count * sizeof(int));
+            int* rat       = OIIO_ALLOCA(int, 2 * count);
             const float* f = (const float*)p.data();
             for (size_t i = 0; i < count; ++i)
                 float_to_rational(f[i], rat[2 * i], rat[2 * i + 1]);
             append_tiff_dir_entry(dirs, data, tag, type, count, rat,
-                                  offset_correction);
+                                  offset_correction, 0, endianreq);
             return;
         }
         break;
     case TIFF_SHORT:
-        if (append_tiff_dir_entry_integer<unsigned short>(p, dirs, data, tag,
-                                                          type,
-                                                          offset_correction))
+        if (append_tiff_dir_entry_integer<unsigned short>(
+                p, dirs, data, tag, type, offset_correction, endianreq))
             return;
         break;
     case TIFF_LONG:
         if (append_tiff_dir_entry_integer<unsigned int>(p, dirs, data, tag,
-                                                        type,
-                                                        offset_correction))
+                                                        type, offset_correction,
+                                                        endianreq))
             return;
         break;
     case TIFF_BYTE:
-        if (append_tiff_dir_entry_integer<unsigned char>(p, dirs, data, tag,
-                                                         type,
-                                                         offset_correction))
+        if (append_tiff_dir_entry_integer<unsigned char>(
+                p, dirs, data, tag, type, offset_correction, endianreq))
             return;
         break;
     default: break;
@@ -1091,14 +1097,24 @@
 bool
 decode_exif(cspan<uint8_t> exif, ImageSpec& spec)
 {
+    // Sometimes an exif blob starts with "Exif". Skip it.
+    if (exif.size() >= 6 && exif[0] == 'E' && exif[1] == 'x' && exif[2] == 'i'
+        && exif[3] == 'f' && exif[4] == 0 && exif[5] == 0) {
+        exif = exif.subspan(6);
+    }
+
 #if DEBUG_EXIF_READ
     std::cerr << "Exif dump:\n";
-    for (size_t i = 0; i < exif.size(); ++i) {
+    for (size_t i = 0; i < std::min(200L, exif.size()); ++i) {
+        if ((i % 16) == 0)
+            std::cerr << "[" << i << "] ";
         if (exif[i] >= ' ')
             std::cerr << (char)exif[i] << ' ';
         std::cerr << "(" << (int)exif[i] << ") ";
+        if ((i % 16) == 15)
+            std::cerr << "\n";
     }
-    std::cerr << "\n";
+    std::cerr << std::endl;
 #endif
 
     // The first item should be a standard TIFF header.  Note that HERE,
@@ -1176,8 +1192,10 @@
 
 template<class T>
 inline void
-append(std::vector<char>& blob, const T& v)
+append(std::vector<char>& blob, T v, endian endianreq = endian::native)
 {
+    if (endianreq != endian::native)
+        swap_endian(&v);
     blob.insert(blob.end(), (const char*)&v, (const char*)&v + sizeof(T));
 }
 
@@ -1191,10 +1209,20 @@
 
 
 
+// DEPRECATED(2.1)
+void
+encode_exif(const ImageSpec& spec, std::vector<char>& blob)
+{
+    encode_exif(spec, blob, endian::native);
+}
+
+
+
 // Construct an Exif data block from the ImageSpec, appending the Exif
 // data as a big blob to the char vector.
 void
-encode_exif(const ImageSpec& spec, std::vector<char>& blob)
+encode_exif(const ImageSpec& spec, std::vector<char>& blob,
+            OIIO::endian endianreq)
 {
     const TagMap& exif_tagmap(exif_tagmap_ref());
     const TagMap& gps_tagmap(gps_tagmap_ref());
@@ -1243,9 +1271,9 @@
     // Put a TIFF header
     size_t tiffstart = blob.size();  // store initial size
     TIFFHeader head;
-    head.tiff_magic   = littleendian() ? 0x4949 : 0x4d4d;
+    head.tiff_magic   = (endianreq == endian::little) ? 0x4949 : 0x4d4d;
     head.tiff_version = 42;
-    // head.tiff_diroff -- fix below, once we know the sizes
+    // N.B. need to swap_endian head.tiff_diroff  below, once we know the sizes
     append(blob, head);
 
     // Accumulate separate tag directories for TIFF, Exif, GPS, and Interop.
@@ -1259,7 +1287,8 @@
         if (Strutil::starts_with(p.name(), "GPS:")) {
             int tag = gps_tagmap.tag(p.name());
             if (tag >= 0)
-                encode_exif_entry(p, tag, gpsdirs, blob, gps_tagmap, tiffstart);
+                encode_exif_entry(p, tag, gpsdirs, blob, gps_tagmap, tiffstart,
+                                  endianreq);
         } else {
             // Not GPS
             int tag = exif_tagmap.tag(p.name());
@@ -1267,10 +1296,10 @@
                 // This range of Exif tags go in the main TIFF directories,
                 // not the Exif IFD. Whatever.
                 encode_exif_entry(p, tag, tiffdirs, blob, exif_tagmap,
-                                  tiffstart);
+                                  tiffstart, endianreq);
             } else {
                 encode_exif_entry(p, tag, exifdirs, blob, exif_tagmap,
-                                  tiffstart);
+                                  tiffstart, endianreq);
             }
         }
     }
@@ -1293,12 +1322,14 @@
     if (exifdirs.size() || makerdirs.size()) {
         // Add some required Exif tags that wouldn't be in the spec
         append_tiff_dir_entry(exifdirs, blob, EXIF_EXIFVERSION, TIFF_UNDEFINED,
-                              4, "0230", tiffstart);
+                              4, "0230", tiffstart, 0, endianreq);
         append_tiff_dir_entry(exifdirs, blob, EXIF_FLASHPIXVERSION,
-                              TIFF_UNDEFINED, 4, "0100", tiffstart);
+                              TIFF_UNDEFINED, 4, "0100", tiffstart, 0,
+                              endianreq);
         static char componentsconfig[] = { 1, 2, 3, 0 };
         append_tiff_dir_entry(exifdirs, blob, EXIF_COMPONENTSCONFIGURATION,
-                              TIFF_UNDEFINED, 4, componentsconfig, tiffstart);
+                              TIFF_UNDEFINED, 4, componentsconfig, tiffstart, 0,
+                              endianreq);
     }
 
     // If any GPS info was found, add a version tag to the GPS fields.
@@ -1306,7 +1337,7 @@
         // Add some required Exif tags that wouldn't be in the spec
         static char ver[] = { 2, 2, 0, 0 };
         append_tiff_dir_entry(gpsdirs, blob, GPSTAG_VERSIONID, TIFF_BYTE, 4,
-                              &ver, tiffstart);
+                              &ver, tiffstart, 0, endianreq);
     }
 
     // Compute offsets:

Avatar utente
ponce
Iper Master
Iper Master
Messaggi: 3022
Iscritto il: mer 5 mar 2008, 16:45
Nome Cognome: Matteo Bernardini
Slackware: slackware64-current
Kernel: 6.6.16
Desktop: lxde
Località: Pisa
Contatta:

Re: Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current

Messaggio da ponce »

gian_d ha scritto:
lun 8 feb 2021, 19:23
Patch oiio-libopenimageio-exif-cpp.diff
Questa risolve il problema dell'aggiornamento di libtiff. Peraltro in un blocco del codice aggiornato c'è anche un commento che fa riferimento proprio alle versioni di libtiff precedenti a 4.2.0

Codice: Seleziona tutto

--- oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp	2019-12-03 23:28:14.000000000 +0100
+++ oiio-Release-2.0.13/src/libOpenImageIO/exif.cpp	2021-02-02 02:54:55.000000000 +0100
@@ -554,40 +528,44 @@
 
 
 
+// libtiff > 4.1.0 defines these in tiff.h. For older libtiff, let's define
+// them ourselves.
+#ifndef GPSTAG_VERSIONID
 enum GPSTag {
-    GPSTAG_VERSIONID         = 0,
-    GPSTAG_LATITUDEREF       = 1,
-    GPSTAG_LATITUDE          = 2,
-    GPSTAG_LONGITUDEREF      = 3,
-    GPSTAG_LONGITUDE         = 4,
-    GPSTAG_ALTITUDEREF       = 5,
-    GPSTAG_ALTITUDE          = 6,
-    GPSTAG_TIMESTAMP         = 7,
-    GPSTAG_SATELLITES        = 8,
-    GPSTAG_STATUS            = 9,
-    GPSTAG_MEASUREMODE       = 10,
-    GPSTAG_DOP               = 11,
-    GPSTAG_SPEEDREF          = 12,
-    GPSTAG_SPEED             = 13,
-    GPSTAG_TRACKREF          = 14,
-    GPSTAG_TRACK             = 15,
-    GPSTAG_IMGDIRECTIONREF   = 16,
-    GPSTAG_IMGDIRECTION      = 17,
-    GPSTAG_MAPDATUM          = 18,
-    GPSTAG_DESTLATITUDEREF   = 19,
-    GPSTAG_DESTLATITUDE      = 20,
-    GPSTAG_DESTLONGITUDEREF  = 21,
-    GPSTAG_DESTLONGITUDE     = 22,
-    GPSTAG_DESTBEARINGREF    = 23,
-    GPSTAG_DESTBEARING       = 24,
-    GPSTAG_DESTDISTANCEREF   = 25,
-    GPSTAG_DESTDISTANCE      = 26,
-    GPSTAG_PROCESSINGMETHOD  = 27,
-    GPSTAG_AREAINFORMATION   = 28,
-    GPSTAG_DATESTAMP         = 29,
-    GPSTAG_DIFFERENTIAL      = 30,
-    GPSTAG_HPOSITIONINGERROR = 31
+    GPSTAG_VERSIONID            = 0,
+    GPSTAG_LATITUDEREF          = 1,
+    GPSTAG_LATITUDE             = 2,
+    GPSTAG_LONGITUDEREF         = 3,
+    GPSTAG_LONGITUDE            = 4,
+    GPSTAG_ALTITUDEREF          = 5,
+    GPSTAG_ALTITUDE             = 6,
+    GPSTAG_TIMESTAMP            = 7,
+    GPSTAG_SATELLITES           = 8,
+    GPSTAG_STATUS               = 9,
+    GPSTAG_MEASUREMODE          = 10,
+    GPSTAG_DOP                  = 11,
+    GPSTAG_SPEEDREF             = 12,
+    GPSTAG_SPEED                = 13,
+    GPSTAG_TRACKREF             = 14,
+    GPSTAG_TRACK                = 15,
+    GPSTAG_IMGDIRECTIONREF      = 16,
+    GPSTAG_IMGDIRECTION         = 17,
+    GPSTAG_MAPDATUM             = 18,
+    GPSTAG_DESTLATITUDEREF      = 19,
+    GPSTAG_DESTLATITUDE         = 20,
+    GPSTAG_DESTLONGITUDEREF     = 21,
+    GPSTAG_DESTLONGITUDE        = 22,
+    GPSTAG_DESTBEARINGREF       = 23,
+    GPSTAG_DESTBEARING          = 24,
+    GPSTAG_DESTDISTANCEREF      = 25,
+    GPSTAG_DESTDISTANCE         = 26,
+    GPSTAG_PROCESSINGMETHOD     = 27,
+    GPSTAG_AREAINFORMATION      = 28,
+    GPSTAG_DATESTAMP            = 29,
+    GPSTAG_DIFFERENTIAL         = 30,
+    GPSTAG_GPSHPOSITIONINGERROR = 31
 };
+#endif
 
 static const TagInfo gps_tag_table[] = {
     // clang-format off
@@ -622,7 +600,7 @@
     { GPSTAG_AREAINFORMATION,	"GPS:AreaInformation",	TIFF_UNDEFINED, 1 },
     { GPSTAG_DATESTAMP,		"GPS:DateStamp",	TIFF_ASCII, 0 },
     { GPSTAG_DIFFERENTIAL,	"GPS:Differential",	TIFF_SHORT, 1 },
-    { GPSTAG_HPOSITIONINGERROR,	"GPS:HPositioningError",TIFF_RATIONAL, 1 }
+    { GPSTAG_GPSHPOSITIONINGERROR,	"GPS:HPositioningError",TIFF_RATIONAL, 1 }
     // clang-format on
 };
 
@@ -685,7 +663,7 @@
     }
     if (dirp->tdir_type == TIFF_RATIONAL) {
         int n    = dirp->tdir_count;  // How many
-        float* f = (float*)alloca(n * sizeof(float));
+        float* f = OIIO_ALLOCA(float, n);
         for (int i = 0; i < n; ++i) {
             unsigned int num, den;
             num = ((const unsigned int*)dataptr)[2 * i + 0];
@@ -704,7 +682,7 @@
     }
     if (dirp->tdir_type == TIFF_SRATIONAL) {
         int n    = dirp->tdir_count;  // How many
-        float* f = (float*)alloca(n * sizeof(float));
+        float* f = OIIO_ALLOCA(float, n);
         for (int i = 0; i < n; ++i) {
             int num, den;
             num = ((const int*)dataptr)[2 * i + 0];
@@ -799,7 +777,7 @@
 
 #if DEBUG_EXIF_READ
     std::cerr << "Read " << tagmap.mapname() << " ";
-    print_dir_entry(tagmap, dir, buf, offset_adjustment);
+    print_dir_entry(std::cerr, tagmap, dir, buf, offset_adjustment);
 #endif
 
     if (dir.tdir_tag == TIFFTAG_EXIFIFD || dir.tdir_tag == TIFFTAG_GPSIFD) {
@@ -808,7 +786,7 @@
         unsigned int offset = dirp->tdir_offset;  // int stored in offset itself
         if (swab)
             swap_endian(&offset);
-        if (offset >= buf.size()) {
+        if (offset >= size_t(buf.size())) {
 #if DEBUG_EXIF_READ
             unsigned int off2 = offset;
             swap_endian(&off2);
@@ -863,6 +841,16 @@
         unsigned int offset = dirp->tdir_offset;  // int stored in offset itself
         if (swab)
             swap_endian(&offset);
+        if (offset >= size_t(buf.size())) {
+#if DEBUG_EXIF_READ
+            unsigned int off2 = offset;
+            swap_endian(&off2);
+            std::cerr << "Bad Exif block? ExifIFD has offset " << offset
+                      << " inexplicably greater than exif buffer length "
+                      << buf.size() << " (byte swapped = " << off2 << ")\n";
+#endif
+            return;
+        }
         // Don't recurse if we've already visited this IFD
         if (ifd_offsets_seen.find(offset) != ifd_offsets_seen.end())
             return;
 
@@ -964,49 +946,46 @@
             const char* s = *(const char**)p.data();
             int len       = strlen(s) + 1;
             append_tiff_dir_entry(dirs, data, tag, type, len, s,
-                                  offset_correction);
+                                  offset_correction, 0, endianreq);
             return;
         }
         break;
     case TIFF_RATIONAL:
         if (element == TypeDesc::FLOAT) {
-            unsigned int* rat = (unsigned int*)alloca(2 * count
-                                                      * sizeof(unsigned int));
+            unsigned int* rat = OIIO_ALLOCA(unsigned int, 2 * count);
             const float* f    = (const float*)p.data();
             for (size_t i = 0; i < count; ++i)
                 float_to_rational(f[i], rat[2 * i], rat[2 * i + 1]);
             append_tiff_dir_entry(dirs, data, tag, type, count, rat,
-                                  offset_correction);
+                                  offset_correction, 0, endianreq);
             return;
         }
         break;
     case TIFF_SRATIONAL:
         if (element == TypeDesc::FLOAT) {
-            int* rat       = (int*)alloca(2 * count * sizeof(int));
+            int* rat       = OIIO_ALLOCA(int, 2 * count);
             const float* f = (const float*)p.data();
             for (size_t i = 0; i < count; ++i)
                 float_to_rational(f[i], rat[2 * i], rat[2 * i + 1]);
             append_tiff_dir_entry(dirs, data, tag, type, count, rat,
-                                  offset_correction);
+                                  offset_correction, 0, endianreq);
             return;
         }
         break;
     case TIFF_SHORT:
-        if (append_tiff_dir_entry_integer<unsigned short>(p, dirs, data, tag,
-                                                          type,
-                                                          offset_correction))
+        if (append_tiff_dir_entry_integer<unsigned short>(
+                p, dirs, data, tag, type, offset_correction, endianreq))
             return;
         break;
     case TIFF_LONG:
         if (append_tiff_dir_entry_integer<unsigned int>(p, dirs, data, tag,
-                                                        type,
-                                                        offset_correction))
+                                                        type, offset_correction,
+                                                        endianreq))
             return;
         break;
     case TIFF_BYTE:
-        if (append_tiff_dir_entry_integer<unsigned char>(p, dirs, data, tag,
-                                                         type,
-                                                         offset_correction))
+        if (append_tiff_dir_entry_integer<unsigned char>(
+                p, dirs, data, tag, type, offset_correction, endianreq))
             return;
         break;
     default: break;
@@ -1091,14 +1097,24 @@
 bool
 decode_exif(cspan<uint8_t> exif, ImageSpec& spec)
 {
+    // Sometimes an exif blob starts with "Exif". Skip it.
+    if (exif.size() >= 6 && exif[0] == 'E' && exif[1] == 'x' && exif[2] == 'i'
+        && exif[3] == 'f' && exif[4] == 0 && exif[5] == 0) {
+        exif = exif.subspan(6);
+    }
+
 #if DEBUG_EXIF_READ
     std::cerr << "Exif dump:\n";
-    for (size_t i = 0; i < exif.size(); ++i) {
+    for (size_t i = 0; i < std::min(200L, exif.size()); ++i) {
+        if ((i % 16) == 0)
+            std::cerr << "[" << i << "] ";
         if (exif[i] >= ' ')
             std::cerr << (char)exif[i] << ' ';
         std::cerr << "(" << (int)exif[i] << ") ";
+        if ((i % 16) == 15)
+            std::cerr << "\n";
     }
-    std::cerr << "\n";
+    std::cerr << std::endl;
 #endif
 
     // The first item should be a standard TIFF header.  Note that HERE,
@@ -1176,8 +1192,10 @@
 
 template<class T>
 inline void
-append(std::vector<char>& blob, const T& v)
+append(std::vector<char>& blob, T v, endian endianreq = endian::native)
 {
+    if (endianreq != endian::native)
+        swap_endian(&v);
     blob.insert(blob.end(), (const char*)&v, (const char*)&v + sizeof(T));
 }
 
@@ -1191,10 +1209,20 @@
 
 
 
+// DEPRECATED(2.1)
+void
+encode_exif(const ImageSpec& spec, std::vector<char>& blob)
+{
+    encode_exif(spec, blob, endian::native);
+}
+
+
+
 // Construct an Exif data block from the ImageSpec, appending the Exif
 // data as a big blob to the char vector.
 void
-encode_exif(const ImageSpec& spec, std::vector<char>& blob)
+encode_exif(const ImageSpec& spec, std::vector<char>& blob,
+            OIIO::endian endianreq)
 {
     const TagMap& exif_tagmap(exif_tagmap_ref());
     const TagMap& gps_tagmap(gps_tagmap_ref());
@@ -1243,9 +1271,9 @@
     // Put a TIFF header
     size_t tiffstart = blob.size();  // store initial size
     TIFFHeader head;
-    head.tiff_magic   = littleendian() ? 0x4949 : 0x4d4d;
+    head.tiff_magic   = (endianreq == endian::little) ? 0x4949 : 0x4d4d;
     head.tiff_version = 42;
-    // head.tiff_diroff -- fix below, once we know the sizes
+    // N.B. need to swap_endian head.tiff_diroff  below, once we know the sizes
     append(blob, head);
 
     // Accumulate separate tag directories for TIFF, Exif, GPS, and Interop.
@@ -1259,7 +1287,8 @@
         if (Strutil::starts_with(p.name(), "GPS:")) {
             int tag = gps_tagmap.tag(p.name());
             if (tag >= 0)
-                encode_exif_entry(p, tag, gpsdirs, blob, gps_tagmap, tiffstart);
+                encode_exif_entry(p, tag, gpsdirs, blob, gps_tagmap, tiffstart,
+                                  endianreq);
         } else {
             // Not GPS
             int tag = exif_tagmap.tag(p.name());
@@ -1267,10 +1296,10 @@
                 // This range of Exif tags go in the main TIFF directories,
                 // not the Exif IFD. Whatever.
                 encode_exif_entry(p, tag, tiffdirs, blob, exif_tagmap,
-                                  tiffstart);
+                                  tiffstart, endianreq);
             } else {
                 encode_exif_entry(p, tag, exifdirs, blob, exif_tagmap,
-                                  tiffstart);
+                                  tiffstart, endianreq);
             }
         }
     }
@@ -1293,12 +1322,14 @@
     if (exifdirs.size() || makerdirs.size()) {
         // Add some required Exif tags that wouldn't be in the spec
         append_tiff_dir_entry(exifdirs, blob, EXIF_EXIFVERSION, TIFF_UNDEFINED,
-                              4, "0230", tiffstart);
+                              4, "0230", tiffstart, 0, endianreq);
         append_tiff_dir_entry(exifdirs, blob, EXIF_FLASHPIXVERSION,
-                              TIFF_UNDEFINED, 4, "0100", tiffstart);
+                              TIFF_UNDEFINED, 4, "0100", tiffstart, 0,
+                              endianreq);
         static char componentsconfig[] = { 1, 2, 3, 0 };
         append_tiff_dir_entry(exifdirs, blob, EXIF_COMPONENTSCONFIGURATION,
-                              TIFF_UNDEFINED, 4, componentsconfig, tiffstart);
+                              TIFF_UNDEFINED, 4, componentsconfig, tiffstart, 0,
+                              endianreq);
     }
 
     // If any GPS info was found, add a version tag to the GPS fields.
@@ -1306,7 +1337,7 @@
         // Add some required Exif tags that wouldn't be in the spec
         static char ver[] = { 2, 2, 0, 0 };
         append_tiff_dir_entry(gpsdirs, blob, GPSTAG_VERSIONID, TIFF_BYTE, 4,
-                              &ver, tiffstart);
+                              &ver, tiffstart, 0, endianreq);
     }
 
     // Compute offsets:
potresti per favore mandarla al maintainer di openimageio, spiegandogli quello che hai fatto, in modo che ci dia un'occhiata anche lui?

gian_d
Linux 3.x
Linux 3.x
Messaggi: 654
Iscritto il: mer 16 lug 2014, 17:35
Nome Cognome: Giancarlo Dessì
Slackware: 64 current
Kernel: 6.6.xx
Desktop: KDE 5.27
Località: Sardinia
Contatta:

Re: Errori di compilazione di OpenImageIO dopo recenti aggiornamenti di current [RISOLTO]

Messaggio da gian_d »

Senza dubbio, avevo già intenzione di farlo :-)

Fatto

Rispondi