refactored code for extracting image dimensions from metadata

(cherry picked from commit 0ece9c5bfad09bc9052238d83fa696ef39effaaa)
This commit is contained in:
Alberto Griggio
2020-12-02 02:03:00 -08:00
committed by Lawrence Lee
parent 0102fca563
commit 92befa7e81
13 changed files with 146 additions and 21 deletions

View File

@@ -81,7 +81,9 @@ FramesData::FramesData(const Glib::ustring &fname) :
lens("Unknown"),
sampleFormat(IIOSF_UNKNOWN),
isPixelShift(false),
isHDR(false)
isHDR(false),
w_(-1),
h_(-1)
{
make.clear();
model.clear();
@@ -374,6 +376,8 @@ FramesData::FramesData(const Glib::ustring &fname) :
}
}
meta.getDimensions(w_, h_);
// -----------------------
// Special file type detection (HDR, PixelShift)
// ------------------------
@@ -773,3 +777,17 @@ void FramesData::fillBasicTags(Exiv2::ExifData &exif) const
strftime(buf, 256, "%Y:%m:%d %H:%M:%S", &t);
set_exif(exif, "Exif.Photo.DateTimeOriginal", buf);
}
void FramesData::getDimensions(int &w, int &h) const
{
w = w_;
h = h_;
}
void FramesData::setDimensions(int w, int h)
{
w_ = w;
h_ = h;
}