imagedata: report if file is DNG

This commit is contained in:
Simone Gotti 2024-06-13 09:42:15 +02:00
parent b98fa42857
commit 5159de89cb
5 changed files with 19 additions and 0 deletions

View File

@ -565,6 +565,8 @@ FramesData::FramesData(const Glib::ustring &fname, time_t ts) :
meta.getDimensions(w_, h_);
isDNG = find_exif_tag("Exif.Image.DNGVersion");
// -----------------------
// Special file type detection (HDR, PixelShift)
// ------------------------
@ -778,6 +780,11 @@ bool FramesData::getHDR() const
return isHDR;
}
bool FramesData::getDNG() const
{
return isDNG;
}
std::string FramesData::getImageType() const
{
return isPixelShift ? "PS" : isHDR ? "HDR" : "STD";

View File

@ -59,6 +59,7 @@ private:
time_t modTimeStamp;
bool isPixelShift;
bool isHDR;
bool isDNG;
int w_;
int h_;
@ -69,6 +70,7 @@ public:
unsigned int getFrameCount() const override;
bool getPixelShift() const override;
bool getHDR() const override;
bool getDNG() const override;
std::string getImageType() const override;
IIOSampleFormat getSampleFormat() const override;
bool hasExif() const override;

View File

@ -130,6 +130,8 @@ public:
virtual bool getPixelShift () const = 0;
/** @return false: not an HDR file ; true: single or multi-frame HDR file (e.g. Pentax HDR raw file or 32 bit float DNG file or Log compressed) */
virtual bool getHDR() const = 0;
/** @return true if the file is a DNG file */
virtual bool getDNG() const = 0;
/** @return false: not an HDR file ; true: single or multi-frame HDR file (e.g. Pentax HDR raw file or 32 bit float DNG file or Log compressed) */
virtual std::string getImageType() const = 0;

View File

@ -59,6 +59,7 @@ CacheImageData::CacheImageData() :
iso(0),
rating(0),
isHDR (false),
isDNG (false),
isPixelShift (false),
sensortype(rtengine::ST_NONE),
sampleFormat(rtengine::IIOSF_UNKNOWN),
@ -194,6 +195,10 @@ int CacheImageData::load (const Glib::ustring& fname)
isHDR = keyFile.get_boolean ("ExifInfo", "IsHDR");
}
if (keyFile.has_key ("ExifInfo", "IsDNG")) {
isDNG = keyFile.get_boolean ("ExifInfo", "IsDNG");
}
if (keyFile.has_key ("ExifInfo", "IsPixelShift")) {
isPixelShift = keyFile.get_boolean ("ExifInfo", "IsPixelShift");
}
@ -316,6 +321,7 @@ int CacheImageData::save (const Glib::ustring& fname)
keyFile.set_double ("ExifInfo", "FocusDist", focusDist);
keyFile.set_integer ("ExifInfo", "ISO", iso);
keyFile.set_boolean ("ExifInfo", "IsHDR", isHDR);
keyFile.set_boolean ("ExifInfo", "IsDNG", isDNG);
keyFile.set_boolean ("ExifInfo", "IsPixelShift", isPixelShift);
keyFile.set_string ("ExifInfo", "ExpComp", expcomp);
}

View File

@ -60,6 +60,7 @@ public:
unsigned iso;
int rating;
bool isHDR;
bool isDNG;
bool isPixelShift;
int sensortype;
rtengine::IIO_Sample_Format sampleFormat;
@ -114,6 +115,7 @@ public:
int getRating () const override { return rating; } // FIXME-piotr : missing rating
bool getPixelShift () const override { return isPixelShift; }
bool getHDR() const override { return isHDR; }
bool getDNG() const override { return isDNG; }
std::string getImageType() const override { return isPixelShift ? "PS" : isHDR ? "HDR" : "STD"; }
rtengine::IIOSampleFormat getSampleFormat() const override { return sampleFormat; }
void getDimensions(int &w, int &h) const override