Use exiv2 for metadata handling

This commit is contained in:
Alberto Griggio
2019-05-06 09:27:44 +02:00
parent a2e2ace1c8
commit c360fd7e2c
49 changed files with 1359 additions and 17510 deletions

View File

@@ -1151,16 +1151,10 @@ private:
if (params.colorappearance.enabled) {
double adap;
int imgNum = 0;
if (imgsrc->getSensorType() == ST_BAYER) {
imgNum = params.raw.bayersensor.imageNum;
} else if (imgsrc->getSensorType() == ST_FUJI_XTRANS) {
//imgNum = params.raw.xtranssensor.imageNum;
}
float fnum = imgsrc->getMetaData()->getFNumber (imgNum); // F number
float fiso = imgsrc->getMetaData()->getISOSpeed (imgNum) ; // ISO
float fspeed = imgsrc->getMetaData()->getShutterSpeed (imgNum) ; //speed
float fcomp = imgsrc->getMetaData()->getExpComp (imgNum); //compensation + -
float fnum = imgsrc->getMetaData()->getFNumber (); // F number
float fiso = imgsrc->getMetaData()->getISOSpeed () ; // ISO
float fspeed = imgsrc->getMetaData()->getShutterSpeed () ; //speed
float fcomp = imgsrc->getMetaData()->getExpComp (); //compensation + -
if (fnum < 0.3f || fiso < 5.f || fspeed < 0.00001f) {
adap = 2000.;
@@ -1295,15 +1289,20 @@ private:
readyImg = tempImage;
}
MetadataInfo info(imgsrc->getFileName());
switch (params.metadata.mode) {
case MetaDataParams::TUNNEL:
// Sending back the whole first root, which won't necessarily be the selected frame number
// and may contain subframe depending on initial raw's hierarchy
readyImg->setMetadata (ii->getMetaData()->getRootExifData ());
// readyImg->setMetadata (ii->getMetaData()->getRootExifData ());
readyImg->setMetadata(info);
break;
case MetaDataParams::EDIT:
info.setExif(params.exif);
info.setIptc(params.iptc);
readyImg->setMetadata(info);
// ask for the correct frame number, but may contain subframe depending on initial raw's hierarchy
readyImg->setMetadata (ii->getMetaData()->getBestExifData(imgsrc, &params.raw), params.exif, params.iptc);
// readyImg->setMetadata (ii->getMetaData()->getBestExifData(imgsrc, &params.raw), params.exif, params.iptc);
break;
default: // case MetaDataParams::STRIP
// nothing to do