From 1a296b763f0b3f032a7115e9cfb112918d3b9851 Mon Sep 17 00:00:00 2001 From: Hombre57 Date: Thu, 10 Aug 2017 00:50:26 +0200 Subject: [PATCH] Correction as discussed in commit review (see also issue #4008) --- rtdata/languages/Francais | 4 +- rtdata/languages/default | 4 +- rtengine/imagedata.cc | 206 +++++++++++++++++++++++++++- rtengine/imagedata.h | 251 +++++++--------------------------- rtengine/imageformat.h | 2 +- rtengine/imagesource.h | 2 +- rtengine/improccoordinator.cc | 4 +- rtengine/rawimagesource.h | 2 +- rtengine/rtengine.h | 46 +++---- rtengine/stdimagesource.h | 2 +- rtexif/rtexif.cc | 8 +- rtexif/rtexif.h | 4 +- rtgui/cacheimagedata.cc | 4 +- rtgui/cacheimagedata.h | 2 +- rtgui/editorpanel.cc | 40 +++--- rtgui/exifpanel.cc | 2 +- 16 files changed, 310 insertions(+), 273 deletions(-) diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 34a9a75a2..de6b6e44e 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -1155,10 +1155,10 @@ PROGRESSBAR_SAVEPNG;Enregistrement du fichier PNG... PROGRESSBAR_SAVETIFF;Enregistrement du fichier TIFF... PROGRESSBAR_SNAPSHOT_ADDED;Signet ajouté PROGRESSDLG_PROFILECHANGEDINBROWSER;Profil modifié dans le navigateur -QINFO_HDR;HDR / %1 image(s) +QINFO_HDR;HDR / %2 image(s) QINFO_ISO;ISO QINFO_NOEXIF;Données EXIF non disponibles. -QINFO_PIXELSHIFT;PixelShift / %1 images +QINFO_PIXELSHIFT;PixelShift / %2 images SAMPLEFORMAT_0;Format de donnée inconnu SAMPLEFORMAT_1;8 bits non signé SAMPLEFORMAT_2;16 bits non signé diff --git a/rtdata/languages/default b/rtdata/languages/default index f8d54154c..f90a8b1f2 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -1157,10 +1157,10 @@ PROGRESSBAR_SAVEPNG;Saving PNG file... PROGRESSBAR_SAVETIFF;Saving TIFF file... PROGRESSBAR_SNAPSHOT_ADDED;Snapshot added PROGRESSDLG_PROFILECHANGEDINBROWSER;Processing profile changed in browser -QINFO_HDR;HDR / %1 frame(s) +QINFO_HDR;HDR / %2 frame(s) QINFO_ISO;ISO QINFO_NOEXIF;Exif data not available. -QINFO_PIXELSHIFT;PixelShift / %1 frame(s) +QINFO_PIXELSHIFT;PixelShift / %2 frame(s) SAMPLEFORMAT_0;Unknown data format SAMPLEFORMAT_1;Unsigned 8 bits SAMPLEFORMAT_2;Unsigned 16 bits diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index 289fc4a25..9c27ddd50 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -626,7 +626,7 @@ FrameData::~FrameData () } } -const procparams::IPTCPairs FrameData::getIPTCData () const +procparams::IPTCPairs FrameData::getIPTCData () const { procparams::IPTCPairs iptcc; @@ -672,6 +672,210 @@ const procparams::IPTCPairs FrameData::getIPTCData () const return iptcc; } + +bool FrameData::getPixelShift () const +{ + return isPixelShift; +} +bool FrameData::getHDR () const +{ + return isHDR; +} +IIOSampleFormat FrameData::getSampleFormat () const +{ + return sampleFormat; +} +rtexif::TagDirectory* FrameData::getExifData () const +{ + return root; +} +bool FrameData::hasExif () const +{ + return root && root->getCount(); +} +bool FrameData::hasIPTC () const +{ + return iptc; +} +tm FrameData::getDateTime () const +{ + return time; +} +time_t FrameData::getDateTimeAsTS () const +{ + return timeStamp; +} +int FrameData::getISOSpeed () const +{ + return iso_speed; +} +double FrameData::getFNumber () const +{ + return aperture; +} +double FrameData::getFocalLen () const +{ + return focal_len; +} +double FrameData::getFocalLen35mm () const +{ + return focal_len35mm; +} +float FrameData::getFocusDist () const +{ + return focus_dist; +} +double FrameData::getShutterSpeed () const +{ + return shutter; +} +double FrameData::getExpComp () const +{ + return expcomp; +} +std::string FrameData::getMake () const +{ + return make; +} +std::string FrameData::getModel () const +{ + return model; +} +std::string FrameData::getLens () const +{ + return lens; +} +std::string FrameData::getSerialNumber () const +{ + return serial; +} +std::string FrameData::getOrientation () const +{ + return orientation; +} + + + +void FramesData::setDCRawFrameCount (unsigned int frameCount) +{ + dcrawFrameCount = frameCount; +} + +unsigned int FramesData::getFrameCount () const +{ + return dcrawFrameCount ? dcrawFrameCount : frames.size(); +} +FrameData *FramesData::getFrameData (int frame) const +{ + return frames.at(frame); +} + +bool FramesData::getPixelShift (unsigned int frame) const +{ + // So far only Pentax provide multi-frame HDR file. + // Only the first frame contains the HDR tag + // If more brand have to be supported, this rule may need + // to evolve + + //return frames.at(frame)->getPixelShift (); + return frames.at(0)->getPixelShift (); +} +bool FramesData::getHDR (unsigned int frame) const +{ + // So far only Pentax provide multi-frame HDR file. + // Only the first frame contains the HDR tag + // If more brand have to be supported, this rule may need + // to evolve + + //return frames.at(frame)->getHDR (); + if (frames.size()) { + return frames.at(0)->getHDR (); + } else { + return 0; + } +} + +IIOSampleFormat FramesData::getSampleFormat (unsigned int frame) const +{ + return frames.at(frame)->getSampleFormat (); +} + +rtexif::TagDirectory* FramesData::getExifData (unsigned int frame) const +{ + return frames.at(frame)->getExifData (); +} +procparams::IPTCPairs FramesData::getIPTCData (unsigned int frame) const +{ + return frames.at(frame)->getIPTCData (); +} + +bool FramesData::hasExif (unsigned int frame) const +{ + return frames.at(frame)->hasExif (); +} +bool FramesData::hasIPTC (unsigned int frame) const +{ + return frames.at(frame)->hasIPTC (); +} + +tm FramesData::getDateTime (unsigned int frame) const +{ + return frames.at(frame)->getDateTime (); +} +time_t FramesData::getDateTimeAsTS(unsigned int frame) const +{ + return frames.at(frame)->getDateTimeAsTS (); +} +int FramesData::getISOSpeed (unsigned int frame) const +{ + return frames.at(frame)->getISOSpeed (); +} +double FramesData::getFNumber (unsigned int frame) const +{ + return frames.at(frame)->getFNumber (); +} +double FramesData::getFocalLen (unsigned int frame) const +{ + return frames.at(frame)->getFocalLen (); +} +double FramesData::getFocalLen35mm (unsigned int frame) const +{ + return frames.at(frame)->getFocalLen35mm (); +} +float FramesData::getFocusDist (unsigned int frame) const +{ + return frames.at(frame)->getFocusDist (); +} +double FramesData::getShutterSpeed (unsigned int frame) const +{ + return frames.at(frame)->getShutterSpeed (); +} +double FramesData::getExpComp (unsigned int frame) const +{ + return frames.at(frame)->getExpComp (); +} +std::string FramesData::getMake (unsigned int frame) const +{ + return frames.at(frame)->getMake (); +} +std::string FramesData::getModel (unsigned int frame) const +{ + return frames.at(frame)->getModel (); +} +std::string FramesData::getLens (unsigned int frame) const +{ + return frames.at(frame)->getLens (); +} +std::string FramesData::getSerialNumber (unsigned int frame) const +{ + return frames.at(frame)->getSerialNumber (); +} +std::string FramesData::getOrientation (unsigned int frame) const +{ + return frames.at(frame)->getOrientation (); +} + + //------inherited functions--------------// diff --git a/rtengine/imagedata.h b/rtengine/imagedata.h index da5b337cb..7474ecab7 100644 --- a/rtengine/imagedata.h +++ b/rtengine/imagedata.h @@ -54,7 +54,7 @@ protected: // each frame has the knowledge of "being an" // or "being part of an" HDR or PS image bool isPixelShift; - int isHDR; // Number of frame + bool isHDR; void extractInfo (); @@ -64,90 +64,27 @@ public: FrameData (rtexif::ExifManager &exifManager); virtual ~FrameData (); - bool getPixelShift () const - { - return isPixelShift; - } - int getHDR () const - { - return isHDR; - } - - IIOSampleFormat getSampleFormat () const - { - return sampleFormat; - } - - const rtexif::TagDirectory* getExifData () const - { - return root; - } - const procparams::IPTCPairs getIPTCData () const; - - bool hasExif () const - { - return root && root->getCount(); - } - bool hasIPTC () const - { - return iptc; - } - - struct tm getDateTime () const { - return time; - } - time_t getDateTimeAsTS() const - { - return timeStamp; - } - int getISOSpeed () const - { - return iso_speed; - } - double getFNumber () const - { - return aperture; - } - double getFocalLen () const - { - return focal_len; - } - double getFocalLen35mm () const - { - return focal_len35mm; - } - float getFocusDist () const - { - return focus_dist; - } - double getShutterSpeed () const - { - return shutter; - } - double getExpComp () const - { - return expcomp; - } - std::string getMake () const - { - return make; - } - std::string getModel () const - { - return model; - } - std::string getLens () const - { - return lens; - } - std::string getSerialNumber () const - { - return serial; - } - std::string getOrientation () const - { - return orientation; - } + bool getPixelShift () const; + bool getHDR () const; + IIOSampleFormat getSampleFormat () const; + rtexif::TagDirectory* getExifData () const; + procparams::IPTCPairs getIPTCData () const; + bool hasExif () const; + bool hasIPTC () const; + tm getDateTime () const; + time_t getDateTimeAsTS () const; + int getISOSpeed () const; + double getFNumber () const; + double getFocalLen () const; + double getFocalLen35mm () const; + float getFocusDist () const; + double getShutterSpeed () const; + double getExpComp () const; + std::string getMake () const; + std::string getModel () const; + std::string getLens () const; + std::string getSerialNumber () const; + std::string getOrientation () const; }; class RawFrameData : public FrameData @@ -171,130 +108,36 @@ public: class FramesData : public FramesMetaData { private: std::vector frames; - int dcrawFrameCount; + unsigned int dcrawFrameCount; public: FramesData (Glib::ustring fname, RawMetaDataLocation* rml = nullptr, bool firstFrameOnly = false, bool loadAll = false); ~FramesData (); - void setDCRawFrameCount (int frameCount) - { - dcrawFrameCount = frameCount; - } - - int getFrameCount () const - { - return dcrawFrameCount ? dcrawFrameCount : frames.size(); - } - FrameData *getFrameData (int frame) const - { - return frames.at(frame); - } - - bool getPixelShift (int frame = 0) const - { - // So far only Pentax provide multi-frame HDR file. - // Only the first frame contains the HDR tag - // If more brand have to be supported, this rule may need - // to evolve - - //return frames.at(frame)->getPixelShift (); - return frames.at(0)->getPixelShift (); - } - int getHDR (int frame = 0) const - { - // So far only Pentax provide multi-frame HDR file. - // Only the first frame contains the HDR tag - // If more brand have to be supported, this rule may need - // to evolve - - //return frames.at(frame)->getPixelShift (); - if (frames.size()) { - return frames.at(frame)->getHDR (); - } else { - return 0; - } - } - - IIOSampleFormat getSampleFormat (int frame = 0) const - { - return frames.at(frame)->getSampleFormat (); - } - - const rtexif::TagDirectory* getExifData (int frame = 0) const - { - return frames.at(frame)->getExifData (); - } - const procparams::IPTCPairs getIPTCData (int frame = 0) const - { - return frames.at(frame)->getIPTCData (); - } - - bool hasExif (int frame = 0) const - { - return frames.at(frame)->hasExif (); - } - bool hasIPTC (int frame = 0) const - { - return frames.at(frame)->hasIPTC (); - } - - struct tm getDateTime (int frame = 0) const { - return frames.at(frame)->getDateTime (); - } - time_t getDateTimeAsTS(int frame = 0) const - { - return frames.at(frame)->getDateTimeAsTS (); - } - int getISOSpeed (int frame = 0) const - { - return frames.at(frame)->getISOSpeed (); - } - double getFNumber (int frame = 0) const - { - return frames.at(frame)->getFNumber (); - } - double getFocalLen (int frame = 0) const - { - return frames.at(frame)->getFocalLen (); - } - double getFocalLen35mm (int frame = 0) const - { - return frames.at(frame)->getFocalLen35mm (); - } - float getFocusDist (int frame = 0) const - { - return frames.at(frame)->getFocusDist (); - } - double getShutterSpeed (int frame = 0) const - { - return frames.at(frame)->getShutterSpeed (); - } - double getExpComp (int frame = 0) const - { - return frames.at(frame)->getExpComp (); - } - std::string getMake (int frame = 0) const - { - return frames.at(frame)->getMake (); - } - std::string getModel (int frame = 0) const - { - return frames.at(frame)->getModel (); - } - std::string getLens (int frame = 0) const - { - return frames.at(frame)->getLens (); - } - std::string getSerialNumber (int frame = 0) const - { - return frames.at(frame)->getSerialNumber (); - } - std::string getOrientation (int frame = 0) const - { - return frames.at(frame)->getOrientation (); - } - + void setDCRawFrameCount (unsigned int frameCount); + unsigned int getFrameCount () const; + FrameData *getFrameData (int frame) const; + bool getPixelShift (unsigned int frame = 0) const; + bool getHDR (unsigned int frame = 0) const; + IIOSampleFormat getSampleFormat (unsigned int frame = 0) const; + rtexif::TagDirectory* getExifData (unsigned int frame = 0) const; + procparams::IPTCPairs getIPTCData (unsigned int frame = 0) const; + bool hasExif (unsigned int frame = 0) const; + bool hasIPTC (unsigned int frame = 0) const; + tm getDateTime (unsigned int frame = 0) const; + time_t getDateTimeAsTS (unsigned int frame = 0) const; + int getISOSpeed (unsigned int frame = 0) const; + double getFNumber (unsigned int frame = 0) const; + double getFocalLen (unsigned int frame = 0) const; + double getFocalLen35mm (unsigned int frame = 0) const; + float getFocusDist (unsigned int frame = 0) const; + double getShutterSpeed (unsigned int frame = 0) const; + double getExpComp (unsigned int frame = 0) const; + std::string getMake (unsigned int frame = 0) const; + std::string getModel (unsigned int frame = 0) const; + std::string getLens (unsigned int frame = 0) const; + std::string getSerialNumber (unsigned int frame = 0) const; + std::string getOrientation (unsigned int frame = 0) const; }; diff --git a/rtengine/imageformat.h b/rtengine/imageformat.h index b34f701b7..2c9bb480d 100644 --- a/rtengine/imageformat.h +++ b/rtengine/imageformat.h @@ -1,7 +1,7 @@ /* * This file is part of RawTherapee. * - * Copyright (c) 20017 Jean-Christophe Frisch + * Copyright (c) 2017 Jean-Christophe Frisch * * RawTherapee is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/rtengine/imagesource.h b/rtengine/imagesource.h index 02f0ec550..e7aa9d1a5 100644 --- a/rtengine/imagesource.h +++ b/rtengine/imagesource.h @@ -78,7 +78,7 @@ public: virtual void HLRecovery_inpaint (float** red, float** green, float** blue) {}; virtual void MSR (LabImage* lab, LUTf & mapcurve, bool &mapcontlutili, int width, int height, int skip, RetinexParams deh, const RetinextransmissionCurve & dehatransmissionCurve, const RetinexgaintransmissionCurve & dehagaintransmissionCurve, float &minCD, float &maxCD, float &mini, float &maxi, float &Tmean, float &Tsigma, float &Tmin, float &Tmax) {}; - virtual bool IsrgbSourceModified () const = 0; // tracks whether cached rgb output of demosaic has been modified + virtual bool IsRGBSourceModified () const = 0; // tracks whether cached rgb output of demosaic has been modified virtual void setCurrentFrame (unsigned int frameNum) = 0; virtual int getFrameCount () = 0; diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc index e7a611f0b..2758ca889 100644 --- a/rtengine/improccoordinator.cc +++ b/rtengine/improccoordinator.cc @@ -220,8 +220,8 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall) if ( (todo & M_RAW) || (!highDetailRawComputed && highDetailNeeded) - || ( params.toneCurve.hrenabled && params.toneCurve.method != "Color" && imgsrc->IsrgbSourceModified()) - || (!params.toneCurve.hrenabled && params.toneCurve.method == "Color" && imgsrc->IsrgbSourceModified())) { + || ( params.toneCurve.hrenabled && params.toneCurve.method != "Color" && imgsrc->IsRGBSourceModified()) + || (!params.toneCurve.hrenabled && params.toneCurve.method == "Color" && imgsrc->IsRGBSourceModified())) { if (settings->verbose) { if (imgsrc->getSensorType() == ST_BAYER) { diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h index 21db71a72..77f277cbf 100644 --- a/rtengine/rawimagesource.h +++ b/rtengine/rawimagesource.h @@ -128,7 +128,7 @@ public: void refinement_lassus (int PassCount); void refinement(int PassCount); - bool IsrgbSourceModified() const + bool IsRGBSourceModified() const { return rgbSourceModified; // tracks whether cached rgb output of demosaic has been modified } diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h index e72f6fbfd..8e6e8430d 100644 --- a/rtengine/rtengine.h +++ b/rtengine/rtengine.h @@ -58,59 +58,59 @@ class FramesMetaData public: /** @return Returns the number of frame contained in the file based on Metadata */ - virtual int getFrameCount () const = 0; + virtual unsigned int getFrameCount () const = 0; /** Checks the availability of exif metadata tags. * @return Returns true if image contains exif metadata tags */ - virtual bool hasExif (int frame = 0) const = 0; + virtual bool hasExif (unsigned int frame = 0) const = 0; /** Returns the directory of exif metadata tags. * @return The directory of exif metadata tags */ - virtual const rtexif::TagDirectory* getExifData (int frame = 0) const = 0; + virtual rtexif::TagDirectory* getExifData (unsigned int frame = 0) const = 0; /** Checks the availability of IPTC tags. * @return Returns true if image contains IPTC tags */ - virtual bool hasIPTC (int frame = 0) const = 0; + virtual bool hasIPTC (unsigned int frame = 0) const = 0; /** Returns the directory of IPTC tags. * @return The directory of IPTC tags */ - virtual const procparams::IPTCPairs getIPTCData (int frame = 0) const = 0; + virtual procparams::IPTCPairs getIPTCData (unsigned int frame = 0) const = 0; /** @return a struct containing the date and time of the image */ - virtual struct tm getDateTime (int frame = 0) const = 0; + virtual tm getDateTime (unsigned int frame = 0) const = 0; /** @return a timestamp containing the date and time of the image */ - virtual time_t getDateTimeAsTS(int frame = 0) const = 0; + virtual time_t getDateTimeAsTS(unsigned int frame = 0) const = 0; /** @return the ISO of the image */ - virtual int getISOSpeed (int frame = 0) const = 0; + virtual int getISOSpeed (unsigned int frame = 0) const = 0; /** @return the F number of the image */ - virtual double getFNumber (int frame = 0) const = 0; + virtual double getFNumber (unsigned int frame = 0) const = 0; /** @return the focal length used at the exposure */ - virtual double getFocalLen (int frame = 0) const = 0; + virtual double getFocalLen (unsigned int frame = 0) const = 0; /** @return the focal length in 35mm used at the exposure */ - virtual double getFocalLen35mm (int frame = 0) const = 0; + virtual double getFocalLen35mm (unsigned int frame = 0) const = 0; /** @return the focus distance in meters, 0=unknown, 10000=infinity */ - virtual float getFocusDist (int frame = 0) const = 0; + virtual float getFocusDist (unsigned int frame = 0) const = 0; /** @return the shutter speed */ - virtual double getShutterSpeed (int frame = 0) const = 0; + virtual double getShutterSpeed (unsigned int frame = 0) const = 0; /** @return the exposure compensation */ - virtual double getExpComp (int frame = 0) const = 0; + virtual double getExpComp (unsigned int frame = 0) const = 0; /** @return the maker of the camera */ - virtual std::string getMake (int frame = 0) const = 0; + virtual std::string getMake (unsigned int frame = 0) const = 0; /** @return the model of the camera */ - virtual std::string getModel (int frame = 0) const = 0; + virtual std::string getModel (unsigned int frame = 0) const = 0; - std::string getCamera (int frame = 0) const + std::string getCamera (unsigned int frame = 0) const { return getMake(frame) + " " + getModel(frame); } /** @return the lens on the camera */ - virtual std::string getLens (int frame = 0) const = 0; + virtual std::string getLens (unsigned int frame = 0) const = 0; /** @return the orientation of the image */ - virtual std::string getOrientation (int frame = 0) const = 0; + virtual std::string getOrientation (unsigned int frame = 0) const = 0; /** @return true if the file is a PixelShift shot (Pentax bodies) */ - virtual bool getPixelShift (int frame = 0) const = 0; + virtual bool getPixelShift (unsigned int frame = 0) const = 0; /** @return 0: not ah HDR file ; 1: single shot HDR (e.g. 32 bit float DNG file or Log compressed) ; >1: multi-frame HDR file */ - virtual int getHDR (int frame = 0) const = 0; + virtual bool getHDR (unsigned int frame = 0) const = 0; /** @return the sample format based on MetaData */ - virtual IIOSampleFormat getSampleFormat (int frame = 0) const = 0; + virtual IIOSampleFormat getSampleFormat (unsigned int frame = 0) const = 0; /** Functions to convert between floating point and string representation of shutter and aperture */ static std::string apertureToString (double aperture); @@ -123,7 +123,7 @@ public: /** Functions to convert between floating point and string representation of exposure compensation */ static std::string expcompToString (double expcomp, bool maskZeroexpcomp); - virtual ~FramesMetaData () {} + virtual ~FramesMetaData () = default; /** Reads metadata from file. * @param fname is the name of the file diff --git a/rtengine/stdimagesource.h b/rtengine/stdimagesource.h index 2e845e3f3..6759e4739 100644 --- a/rtengine/stdimagesource.h +++ b/rtengine/stdimagesource.h @@ -93,7 +93,7 @@ public: void convertColorSpace(Imagefloat* image, const ColorManagementParams &cmp, const ColorTemp &wb);// RAWParams raw will not be used for non-raw files (see imagesource.h) static void colorSpaceConversion (Imagefloat* im, const ColorManagementParams &cmp, cmsHPROFILE embedded, IIOSampleFormat sampleFormat); - bool IsrgbSourceModified() const + bool IsRGBSourceModified() const { return rgbSourceModified; } diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index 7c508892a..b242c2cbd 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -290,7 +290,7 @@ bool TagDirectory::CPBDump (const Glib::ustring &commFName, const Glib::ustring kf->set_double ("Common Data", "Shutter", cfs->shutter); kf->set_double ("Common Data", "FocalLength", cfs->focalLen); kf->set_integer ("Common Data", "ISO", cfs->iso); - kf->set_integer ("Common Data", "IsHDR", cfs->isHDR); + kf->set_boolean ("Common Data", "IsHDR", cfs->isHDR); kf->set_boolean ("Common Data", "IsPixelShift", cfs->isPixelShift); kf->set_string ("Common Data", "Lens", cfs->lens); kf->set_string ("Common Data", "Make", cfs->camMake); @@ -2881,10 +2881,8 @@ TagDirectory* ExifManager::parseTIFF (bool skipIgnored) { if (!rml) { - rml = new rtengine::RawMetaDataLocation(0); - TagDirectory* tagDir = parse (skipIgnored); - delete rml; - return tagDir; + std::unique_ptr rml(new rtengine::RawMetaDataLocation(0)); + return parse (skipIgnored); } else { return parse (skipIgnored); } diff --git a/rtexif/rtexif.h b/rtexif/rtexif.h index c476e3dc9..5821c58f5 100644 --- a/rtexif/rtexif.h +++ b/rtexif/rtexif.h @@ -49,7 +49,7 @@ enum ActionCode { }; enum ByteOrder {UNKNOWN = 0, INTEL = 0x4949, MOTOROLA = 0x4D4D}; #if __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__ -const enum ByteOrder HOSTORDER = INTEL; +const ByteOrder HOSTORDER = INTEL; #else const enum ByteOrder HOSTORDER = MOTOROLA; #endif @@ -312,6 +312,7 @@ class ExifManager Tag* saveCIFFMNTag (TagDirectory* root, int len, const char* name); TagDirectory* parseIFD (int ifdOffset, bool skipIgnored); + void parseCIFF (int length, TagDirectory* root); public: FILE* f; @@ -340,7 +341,6 @@ public: TagDirectory* parseJPEG (int offset = 0); // offset: to extract exif data from a embedded preview/thumbnail TagDirectory* parseTIFF (bool skipIgnored = true); TagDirectory* parseCIFF (); - void parseCIFF (int length, TagDirectory* root); /// @brief Get default tag for TIFF /// @param forthis The byte order will be taken from the given directory. diff --git a/rtgui/cacheimagedata.cc b/rtgui/cacheimagedata.cc index e1a3eaba3..5726b041d 100644 --- a/rtgui/cacheimagedata.cc +++ b/rtgui/cacheimagedata.cc @@ -25,7 +25,7 @@ CacheImageData::CacheImageData () : md5(""), supported(false), format(FT_Invalid), rankOld(-1), inTrashOld(false), recentlySaved(false), timeValid(false), year(0), month(0), day(0), hour(0), min(0), sec(0), exifValid(false), - fnumber(0.0), shutter(0.0), focalLen(0.0), focalLen35mm(0.0), focusDist(0.f), iso(0), isHDR (0), isPixelShift (false), + fnumber(0.0), shutter(0.0), focalLen(0.0), focalLen35mm(0.0), focusDist(0.f), iso(0), isHDR (false), isPixelShift (false), sampleFormat(rtengine::IIOSF_UNKNOWN), redAWBMul(-1.0), greenAWBMul(-1.0), blueAWBMul(-1.0), rotate(0), thumbImgType(0) { } @@ -246,7 +246,7 @@ int CacheImageData::save (const Glib::ustring& fname) keyFile.set_double ("ExifInfo", "FocalLen35mm", focalLen35mm); keyFile.set_double ("ExifInfo", "FocusDist", focusDist); keyFile.set_integer ("ExifInfo", "ISO", iso); - keyFile.set_integer ("ExifInfo", "IsHDR", isHDR); + keyFile.set_boolean ("ExifInfo", "IsHDR", isHDR); keyFile.set_boolean ("ExifInfo", "IsPixelShift", isPixelShift); keyFile.set_string ("ExifInfo", "ExpComp", expcomp); } diff --git a/rtgui/cacheimagedata.h b/rtgui/cacheimagedata.h index 548633168..1934442d1 100644 --- a/rtgui/cacheimagedata.h +++ b/rtgui/cacheimagedata.h @@ -52,7 +52,7 @@ public: double focalLen, focalLen35mm; float focusDist; unsigned iso; - int isHDR; // null if no HDR, otherwise provide the number of frame for this HDR file + bool isHDR; bool isPixelShift; rtengine::IIO_Sample_Format sampleFormat; Glib::ustring lens; diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 1566f3c07..c1760c1ff 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1264,11 +1264,6 @@ void EditorPanel::info_toggled () { Glib::ustring infoString; - Glib::ustring infoString1; //1-st line - Glib::ustring infoString2; //2-nd line - Glib::ustring infoString3; //3-rd line - Glib::ustring infoString4; //4-th line - Glib::ustring infoString5; //5-th line Glib::ustring expcomp; if (!ipc || !openThm) { @@ -1278,11 +1273,9 @@ void EditorPanel::info_toggled () const rtengine::FramesMetaData* idata = ipc->getInitialImage()->getMetaData(); if (idata && idata->hasExif()) { - infoString1 = Glib::ustring::compose ("%1 + %2", + infoString = Glib::ustring::compose ("%1 + %2\nf/%3 %4s %5%6 %7mm", Glib::ustring (idata->getMake() + " " + idata->getModel()), - Glib::ustring (idata->getLens())); - - infoString2 = Glib::ustring::compose ("f/%1 %2s %3%4 %5mm", + Glib::ustring (idata->getLens()), Glib::ustring (idata->apertureToString (idata->getFNumber())), Glib::ustring (idata->shutterToString (idata->getShutterSpeed())), M ("QINFO_ISO"), idata->getISOSpeed(), @@ -1290,40 +1283,39 @@ void EditorPanel::info_toggled () expcomp = Glib::ustring (idata->expcompToString (idata->getExpComp(), true)); // maskZeroexpcomp - if (expcomp != "") { - infoString2 = Glib::ustring::compose ("%1 %2EV", - infoString2, + if (!expcomp.empty ()) { + infoString = Glib::ustring::compose ("%1 %2EV", + infoString, expcomp /*Glib::ustring(idata->expcompToString(idata->getExpComp()))*/); } - infoString3 = Glib::ustring::compose ("%1%2", + infoString = Glib::ustring::compose ("%1\n%2%3", + infoString, escapeHtmlChars (Glib::path_get_dirname (openThm->getFileName())) + G_DIR_SEPARATOR_S, escapeHtmlChars (Glib::path_get_basename (openThm->getFileName())) ); int ww = ipc->getFullWidth(); int hh = ipc->getFullHeight(); //megapixels - infoString4 = Glib::ustring::compose ("%1 MP (%2x%3)", Glib::ustring::format (std::setw (4), std::fixed, std::setprecision (1), (float)ww * hh / 1000000), ww, hh); - - infoString = Glib::ustring::compose ("%1\n%2\n%3\n%4", infoString1, infoString2, infoString3, infoString4); + infoString = Glib::ustring::compose ("%1\n%2 MP (%2x%3)", + infoString, + Glib::ustring::format (std::setw (4), std::fixed, std::setprecision (1), (float)ww * hh / 1000000), + ww, hh); //adding special characteristics bool isHDR = idata->getHDR(); bool isPixelShift = idata->getPixelShift(); - int numFrames = idata->getFrameCount(); + unsigned int numFrames = idata->getFrameCount(); if (isHDR) { - infoString5 = Glib::ustring::compose (M("QINFO_HDR"), numFrames); + infoString = Glib::ustring::compose ("%1\n" + M("QINFO_HDR"), infoString, numFrames); if (numFrames == 1) { int sampleFormat = idata->getSampleFormat(); - infoString5 = Glib::ustring::compose ("%1 / %2", infoString5, M(Glib::ustring::compose("SAMPLEFORMAT_%1", sampleFormat))); + infoString = Glib::ustring::compose ("%1 / %2", infoString, M(Glib::ustring::compose("SAMPLEFORMAT_%1", sampleFormat))); } } else if (isPixelShift) { - infoString5 = Glib::ustring::compose (M("QINFO_PIXELSHIFT"), numFrames); + infoString = Glib::ustring::compose ("%1\n" + M("QINFO_HDR"), infoString, numFrames); + infoString = Glib::ustring::compose ("%1\n" + M("QINFO_PIXELSHIFT"), infoString, numFrames); } - if (!infoString5.empty()) { - infoString = Glib::ustring::compose ("%1\n%2", infoString, infoString5); - } - } else { infoString = M ("QINFO_NOEXIF"); } diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc index 370a29c77..1f5b7d999 100644 --- a/rtgui/exifpanel.cc +++ b/rtgui/exifpanel.cc @@ -186,7 +186,7 @@ void ExifPanel::setImageData (const FramesMetaData* id) if (id) { //bool first = true; // HOMBRE: Should we only display the current frame's Exifs ? - for (int frameNum = 0; frameNum < id->getFrameCount (); ++frameNum) { + for (unsigned int frameNum = 0; frameNum < id->getFrameCount (); ++frameNum) { if ( id->getExifData (frameNum)) { /* if (!first) {