metadata: initialize thumbnail rating from exif

(cherry picked from commit 96bd2db0d2e127678bded3bee7aa3275332826c0)
This commit is contained in:
Alberto Griggio
2019-05-20 01:56:38 -07:00
committed by Lawrence Lee
parent 38d87bae72
commit b01b0fbef0
4 changed files with 15 additions and 10 deletions

View File

@@ -287,6 +287,10 @@ FramesData::FramesData(const Glib::ustring &fname) :
expcomp = pos->toFloat();
}
if (find_exif_tag("Exif.Image.Rating")) {
rating = pos->toLong();
}
// -----------------------
// Special file type detection (HDR, PixelShift)
// ------------------------
@@ -567,12 +571,6 @@ std::string FramesData::getOrientation() const
}
int FramesData::getRating() const
{
return rating;
}
void FramesData::setDCRawFrameCount(unsigned int frameCount)
{
dcrawFrameCount = frameCount;
@@ -589,6 +587,12 @@ Glib::ustring FramesData::getFileName() const
return fname_;
}
int FramesData::getRating() const
{
return rating;
}
//------inherited functions--------------//
std::string FramesMetaData::apertureToString(double aperture)

View File

@@ -81,8 +81,8 @@ public:
std::string getLens() const override;
std::string getSerialNumber() const;
std::string getOrientation() const override;
int getRating() const override;
Glib::ustring getFileName() const override;
int getRating() const override;
};
}

View File

@@ -1,4 +1,5 @@
/*
/* -*- C++ -*-
*
* This file is part of RawTherapee.
*
* Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com>
@@ -122,7 +123,7 @@ public:
/** @return the orientation of the image */
virtual std::string getOrientation() const = 0;
/** @return the rating of the image */
virtual int getRating () const = 0;
virtual int getRating() const = 0;
/** @return true if the file is a PixelShift shot (Pentax and Sony bodies) */
virtual bool getPixelShift () const = 0;

View File

@@ -387,7 +387,7 @@ void Thumbnail::notifylisterners_procParamsChanged(int whoChangedIt)
* The result is a complete ProcParams with default values merged with the values
* from the loaded ProcParams (sidecar or cache file).
*/
void Thumbnail::loadProcParams ()
void Thumbnail::loadProcParams()
{
MyMutex::MyLock lock(mutex);