-The order of the values in *flgs* is not respected. For example, the order
-of the columns, using some tags from *Stonehenge.jpg*, is as follows:
+The order of the values in *flgs* is not respected and is output as follows:
-```
-$ curl --silent -O https://www.exiv2.org/Stonehenge.jpg
-$ exiv2 --Print xgknlycst Stonehenge.jpg
-```
+| Tag number
(x) | Plain 'set'
(V) | Group
(g) | Key
(k) | Tagname
(n) | Tagname label
(l) |Description
(d) | Type
(y) | Comp
(c) | Size
(s) | Value
(v) | Translated
(t) |
+|:------ |:---- |:------ |:------ |:------ |:------ |:------ |:------ |:------ |:------ |:--- |:------ |
-| Tag number
(x) | Plain 'set'
(V) | Group
(g) | Key
(k) | Tagname
(n) | Tagname label
(l) | Type
(y) | Comp
(c) | Size
(s) | Value
(E, I, X, v, t) | Translated
(t) |
-|:------ |:---- |:------ |:------ |:------ |:------ |:------ |:------ |:------ |:------ |:------ |
-| 0x0110 | set | Image | Exif.Image.Model | Model | Model | Ascii | 12 | 12 | NIKON D5300 | NIKON D5300 |
-| 0x0006 | set | NikonIi | Exif.NikonIi.ISO2 | ISO2 | ISO 2 | Byte | 1 | 1 | 72 | 200 |
-| 0x0000 | set | xmp | Xmp.xmp.Rating | Rating | Rating | XmpText | 1 | 1 | 0 | 0 |
-| 0x0000 | set | dc | Xmp.dc.Family | Family | Family | XmpBag | 1 | 5 | Robin | Robin |
+For example,
-**--Print** *flgs* can be combined with [--grep str](#grep_str) or
-[--key key](#key_key) to further filter the output.
+```bash
+$ curl --silent -O https://www.exiv2.org/Stonehenge.jpg
+$ exiv2 --Print xVgknldycsvt -K Exif.Nikon3.Quality Stonehenge.jpg
+0x0004 set Nikon3 Exif.Nikon3.Quality Quality Quality Image quality setting Ascii 8 8 NORMAL NORMAL
+```
diff --git a/include/exiv2/basicio.hpp b/include/exiv2/basicio.hpp
index 869a8044..3df4625c 100644
--- a/include/exiv2/basicio.hpp
+++ b/include/exiv2/basicio.hpp
@@ -198,10 +198,9 @@ class EXIV2API BasicIo {
//@{
/*!
@brief Get the current IO position.
- @return Offset from the start of IO if successful;
- -1 if failure;
+ @return Offset from the start of IO
*/
- [[nodiscard]] virtual long tell() const = 0;
+ [[nodiscard]] virtual size_t tell() const = 0;
/*!
@brief Get the current size of the IO source in bytes.
@return Size of the IO source in bytes;
@@ -439,10 +438,9 @@ class EXIV2API FileIo : public BasicIo {
//@{
/*!
@brief Get the current file position.
- @return Offset from the start of the file if successful;
- -1 if failure;
+ @return Offset from the start of the file
*/
- [[nodiscard]] long tell() const override;
+ [[nodiscard]] size_t tell() const override;
/*!
@brief Flush any buffered writes and get the current file size
in bytes.
@@ -624,7 +622,7 @@ class EXIV2API MemIo : public BasicIo {
@brief Get the current IO position.
@return Offset from the start of the memory block
*/
- [[nodiscard]] long tell() const override;
+ [[nodiscard]] size_t tell() const override;
/*!
@brief Get the current memory buffer size in bytes.
@return Size of the in memory data in bytes;
@@ -695,12 +693,12 @@ class EXIV2API XPathIo : public FileIo {
@brief The extension of the temporary file which is created when getting input data
to read metadata. This file will be deleted in destructor.
*/
- static constexpr std::string_view TEMP_FILE_EXT = ".exiv2_temp";
+ static constexpr auto TEMP_FILE_EXT = ".exiv2_temp";
/*!
@brief The extension of the generated file which is created when getting input data
to add or modify the metadata.
*/
- static constexpr std::string_view GEN_FILE_EXT = ".exiv2";
+ static constexpr auto GEN_FILE_EXT = ".exiv2";
//! @name Creators
//@{
@@ -737,7 +735,7 @@ class EXIV2API XPathIo : public FileIo {
private:
// True if the file is a temporary file and it should be deleted in destructor.
- bool isTemp_;
+ bool isTemp_{true};
std::string tempFilePath_;
}; // class XPathIo
#endif
@@ -874,7 +872,7 @@ class EXIV2API RemoteIo : public BasicIo {
@brief Get the current IO position.
@return Offset from the start of the memory block
*/
- [[nodiscard]] long tell() const override;
+ [[nodiscard]] size_t tell() const override;
/*!
@brief Get the current memory buffer size in bytes.
@return Size of the in memory data in bytes;
diff --git a/include/exiv2/bmffimage.hpp b/include/exiv2/bmffimage.hpp
index cefa9212..ac395606 100644
--- a/include/exiv2/bmffimage.hpp
+++ b/include/exiv2/bmffimage.hpp
@@ -14,7 +14,7 @@
// namespace extensions
namespace Exiv2 {
EXIV2API bool enableBMFF(bool enable = true);
-}
+} // namespace Exiv2
#ifdef EXV_ENABLE_BMFF
namespace Exiv2 {
@@ -97,15 +97,15 @@ class EXIV2API BmffImage : public Image {
//! @name Manipulators
//@{
- void readMetadata() override /* override */;
- void writeMetadata() override /* override */;
- void setComment(std::string_view comment) override /* override */;
+ void readMetadata() override;
+ void writeMetadata() override;
+ void setComment(const std::string& comment) override;
void printStructure(std::ostream& out, Exiv2::PrintStructureOption option, int depth) override;
//@}
//! @name Accessors
//@{
- [[nodiscard]] std::string mimeType() const override /* override */;
+ [[nodiscard]] std::string mimeType() const override;
[[nodiscard]] uint32_t pixelWidth() const override;
[[nodiscard]] uint32_t pixelHeight() const override;
//@}
@@ -122,13 +122,13 @@ class EXIV2API BmffImage : public Image {
@return address of next box
@warning This function should only be called by readMetadata()
*/
- long boxHandler(std::ostream& out, Exiv2::PrintStructureOption option, long pbox_end, int depth);
+ uint64_t boxHandler(std::ostream& out, Exiv2::PrintStructureOption option, uint64_t pbox_end, int depth);
[[nodiscard]] static std::string indent(int i) {
return std::string(2 * i, ' ');
}
uint32_t fileType_{0};
- std::set visits_;
+ std::set visits_;
uint64_t visits_max_{0};
uint16_t unknownID_{0xffff};
uint16_t exifID_{0xffff};
@@ -140,7 +140,7 @@ class EXIV2API BmffImage : public Image {
/*!
@brief box utilities
*/
- static std::string toAscii(long n);
+ static std::string toAscii(uint32_t n);
std::string boxName(uint32_t box);
static bool superBox(uint32_t box);
static bool fullBox(uint32_t box);
diff --git a/include/exiv2/bmpimage.hpp b/include/exiv2/bmpimage.hpp
index b37d41b2..616ca0f2 100644
--- a/include/exiv2/bmpimage.hpp
+++ b/include/exiv2/bmpimage.hpp
@@ -66,7 +66,7 @@ class EXIV2API BmpImage : public Image {
void setIptcData(const IptcData& iptcData) override;
/// @throws Error(ErrorCode::kerInvalidSettingForImage)
- void setComment(std::string_view comment) override;
+ void setComment(const std::string&) override;
//@}
//! @name Accessors
diff --git a/include/exiv2/cr2image.hpp b/include/exiv2/cr2image.hpp
index a7fc663d..9b67db42 100644
--- a/include/exiv2/cr2image.hpp
+++ b/include/exiv2/cr2image.hpp
@@ -61,7 +61,7 @@ class EXIV2API Cr2Image : public Image {
@brief Not supported. CR2 format does not contain a comment.
Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage).
*/
- void setComment(std::string_view comment) override;
+ void setComment(const std::string&) override;
//@}
//! @name Accessors
diff --git a/include/exiv2/datasets.hpp b/include/exiv2/datasets.hpp
index 2d06e9e3..491a379d 100644
--- a/include/exiv2/datasets.hpp
+++ b/include/exiv2/datasets.hpp
@@ -280,6 +280,7 @@ class EXIV2API IptcKey : public Key {
[[nodiscard]] std::string groupName() const override;
[[nodiscard]] std::string tagName() const override;
[[nodiscard]] std::string tagLabel() const override;
+ [[nodiscard]] std::string tagDesc() const override;
[[nodiscard]] uint16_t tag() const override;
[[nodiscard]] UniquePtr clone() const;
//! Return the name of the record
diff --git a/include/exiv2/epsimage.hpp b/include/exiv2/epsimage.hpp
index a4b56b86..52135a88 100644
--- a/include/exiv2/epsimage.hpp
+++ b/include/exiv2/epsimage.hpp
@@ -65,7 +65,7 @@ class EXIV2API EpsImage : public Image {
@brief Not supported.
Calling this function will throw an instance of Error(ErrorCode::kerInvalidSettingForImage).
*/
- void setComment(std::string_view comment) override;
+ void setComment(const std::string&) override;
//@}
//! @name Accessors
diff --git a/include/exiv2/exif.hpp b/include/exiv2/exif.hpp
index c052513a..29796541 100644
--- a/include/exiv2/exif.hpp
+++ b/include/exiv2/exif.hpp
@@ -140,9 +140,10 @@ class EXIV2API Exifdatum : public Metadatum {
[[nodiscard]] std::string groupName() const override;
[[nodiscard]] std::string tagName() const override;
[[nodiscard]] std::string tagLabel() const override;
+ [[nodiscard]] std::string tagDesc() const override;
[[nodiscard]] uint16_t tag() const override;
//! Return the IFD id as an integer. (Do not use, this is meant for library internal use.)
- [[nodiscard]] int ifdId() const;
+ [[nodiscard]] IfdId ifdId() const;
//! Return the name of the IFD
[[nodiscard]] const char* ifdName() const;
//! Return the index (unique id of this key within the original IFD)
diff --git a/include/exiv2/futils.hpp b/include/exiv2/futils.hpp
index d454846e..312391d9 100644
--- a/include/exiv2/futils.hpp
+++ b/include/exiv2/futils.hpp
@@ -31,7 +31,7 @@ EXIV2API std::string getEnv(int env_var);
@note Source: http://www.geekhideout.com/urlcode.shtml
@todo This function can probably be hidden into the implementation details
*/
-EXIV2API std::string urlencode(std::string_view str);
+EXIV2API std::string urlencode(const std::string& str);
/*!
@brief Like urlencode(char* str) but accept the input url in the std::string and modify it.
diff --git a/include/exiv2/gifimage.hpp b/include/exiv2/gifimage.hpp
index 93bd422f..b518219e 100644
--- a/include/exiv2/gifimage.hpp
+++ b/include/exiv2/gifimage.hpp
@@ -69,7 +69,7 @@ class EXIV2API GifImage : public Image {
@brief Not supported. Calling this function will throw an instance
of Error(ErrorCode::kerInvalidSettingForImage).
*/
- void setComment(std::string_view comment) override;
+ void setComment(const std::string&) override;
//@}
//! @name Accessors
diff --git a/include/exiv2/image.hpp b/include/exiv2/image.hpp
index 2a968fc3..1fd6bf1e 100644
--- a/include/exiv2/image.hpp
+++ b/include/exiv2/image.hpp
@@ -177,7 +177,7 @@ class EXIV2API Image {
virtual void clearXmpData();
/// @brief Set the image comment. The comment is written to the image when writeMetadata() is called.
- virtual void setComment(std::string_view comment);
+ virtual void setComment(const std::string& comment);
/*!
@brief Erase any buffered comment. Comment is not removed
@@ -467,8 +467,8 @@ class EXIV2API Image {
DataBuf iccProfile_; //!< ICC buffer (binary data)
std::string comment_; //!< User comment
std::string xmpPacket_; //!< XMP packet
- uint32_t pixelWidth_; //!< image pixel width
- uint32_t pixelHeight_; //!< image pixel height
+ uint32_t pixelWidth_{0}; //!< image pixel width
+ uint32_t pixelHeight_{0}; //!< image pixel height
NativePreviewList nativePreviews_; //!< list of native previews
//! Return tag name for given tag id.
@@ -479,13 +479,13 @@ class EXIV2API Image {
private:
// DATA
- ImageType imageType_; //!< Image type
- uint16_t supportedMetadata_; //!< Bitmap with all supported metadata types
- bool writeXmpFromPacket_; //!< Determines the source when writing XMP
- ByteOrder byteOrder_; //!< Byte order
+ ImageType imageType_; //!< Image type
+ uint16_t supportedMetadata_; //!< Bitmap with all supported metadata types
+ bool writeXmpFromPacket_; //!< Determines the source when writing XMP
+ ByteOrder byteOrder_{invalidByteOrder}; //!< Byte order
std::map tags_; //!< Map of tags
- bool init_; //!< Flag marking if map of tags needs to be initialized
+ bool init_{true}; //!< Flag marking if map of tags needs to be initialized
}; // class Image
diff --git a/include/exiv2/iptc.hpp b/include/exiv2/iptc.hpp
index 56dde0e5..64caba10 100644
--- a/include/exiv2/iptc.hpp
+++ b/include/exiv2/iptc.hpp
@@ -113,6 +113,7 @@ class EXIV2API Iptcdatum : public Metadatum {
*/
[[nodiscard]] std::string tagName() const override;
[[nodiscard]] std::string tagLabel() const override;
+ [[nodiscard]] std::string tagDesc() const override;
//! Return the tag (aka dataset) number
[[nodiscard]] uint16_t tag() const override;
[[nodiscard]] TypeId typeId() const override;
diff --git a/include/exiv2/jp2image.hpp b/include/exiv2/jp2image.hpp
index ae1a03e6..ea43dc92 100644
--- a/include/exiv2/jp2image.hpp
+++ b/include/exiv2/jp2image.hpp
@@ -56,7 +56,7 @@ class EXIV2API Jp2Image : public Image {
@brief Todo: Not supported yet(?). Calling this function will throw
an instance of Error(ErrorCode::kerInvalidSettingForImage).
*/
- void setComment(std::string_view comment) override;
+ void setComment(const std::string&) override;
//@}
//! @name Accessors
diff --git a/include/exiv2/metadatum.hpp b/include/exiv2/metadatum.hpp
index d54b2ac3..982b641b 100644
--- a/include/exiv2/metadatum.hpp
+++ b/include/exiv2/metadatum.hpp
@@ -52,6 +52,8 @@ class EXIV2API Key {
[[nodiscard]] virtual std::string tagName() const = 0;
//! Return a label for the tag
[[nodiscard]] virtual std::string tagLabel() const = 0;
+ //! Return a description for the tag
+ [[nodiscard]] virtual std::string tagDesc() const = 0;
//! Return the tag number
[[nodiscard]] virtual uint16_t tag() const = 0;
/*!
@@ -181,6 +183,8 @@ class EXIV2API Metadatum {
[[nodiscard]] virtual std::string tagName() const = 0;
//! Return a label for the tag
[[nodiscard]] virtual std::string tagLabel() const = 0;
+ //! Return a description for the tag
+ [[nodiscard]] virtual std::string tagDesc() const = 0;
//! Return the tag
[[nodiscard]] virtual uint16_t tag() const = 0;
//! Return the type id of the value
diff --git a/include/exiv2/mrwimage.hpp b/include/exiv2/mrwimage.hpp
index 8abd8df8..68dd5e91 100644
--- a/include/exiv2/mrwimage.hpp
+++ b/include/exiv2/mrwimage.hpp
@@ -72,7 +72,7 @@ class EXIV2API MrwImage : public Image {
@brief Not supported. MRW format does not contain a comment.
Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage).
*/
- void setComment(std::string_view comment) override;
+ void setComment(const std::string&) override;
//@}
//! @name Accessors
diff --git a/include/exiv2/orfimage.hpp b/include/exiv2/orfimage.hpp
index 89df53bf..6fe8fed1 100644
--- a/include/exiv2/orfimage.hpp
+++ b/include/exiv2/orfimage.hpp
@@ -59,7 +59,7 @@ class EXIV2API OrfImage : public TiffImage {
@brief Not supported. ORF format does not contain a comment.
Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage).
*/
- void setComment(std::string_view comment) override;
+ void setComment(const std::string&) override;
//@}
//! @name Accessors
diff --git a/include/exiv2/photoshop.hpp b/include/exiv2/photoshop.hpp
index 31c420ad..4b140401 100644
--- a/include/exiv2/photoshop.hpp
+++ b/include/exiv2/photoshop.hpp
@@ -16,10 +16,10 @@ class IptcData;
/// @brief Helper class, has methods to deal with %Photoshop "Information Resource Blocks" (IRBs).
struct EXIV2API Photoshop {
// Todo: Public for now
- static constexpr std::array irbId_{"8BIM", "AgHg", "DCSR", "PHUT"}; //!< %Photoshop IRB markers
- static constexpr auto ps3Id_ = "Photoshop 3.0\0"; //!< %Photoshop marker
- static constexpr uint16_t iptc_ = 0x0404; //!< %Photoshop IPTC marker
- static constexpr uint16_t preview_ = 0x040c; //!< %Photoshop preview marker
+ static constexpr std::array irbId_{"8BIM", "AgHg", "DCSR", "PHUT"}; //!< %Photoshop IRB markers
+ static constexpr auto ps3Id_ = "Photoshop 3.0\0"; //!< %Photoshop marker
+ static constexpr uint16_t iptc_ = 0x0404; //!< %Photoshop IPTC marker
+ static constexpr uint16_t preview_ = 0x040c; //!< %Photoshop preview marker
/// @brief Checks an IRB
/// @param pPsData Existing IRB buffer. It is expected to be of size 4.
diff --git a/include/exiv2/properties.hpp b/include/exiv2/properties.hpp
index 36dc8179..a2f1ce88 100644
--- a/include/exiv2/properties.hpp
+++ b/include/exiv2/properties.hpp
@@ -8,6 +8,7 @@
// included header files
#include
+
#include "datasets.hpp"
// *****************************************************************************
@@ -262,6 +263,7 @@ class EXIV2API XmpKey : public Key {
[[nodiscard]] std::string groupName() const override;
[[nodiscard]] std::string tagName() const override;
[[nodiscard]] std::string tagLabel() const override;
+ [[nodiscard]] std::string tagDesc() const override;
//! Properties don't have a tag number. Return 0.
[[nodiscard]] uint16_t tag() const override;
diff --git a/include/exiv2/psdimage.hpp b/include/exiv2/psdimage.hpp
index f0585343..19ac37aa 100644
--- a/include/exiv2/psdimage.hpp
+++ b/include/exiv2/psdimage.hpp
@@ -53,7 +53,7 @@ class EXIV2API PsdImage : public Image {
/*!
@brief Not supported. Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage).
*/
- void setComment(std::string_view comment) override;
+ void setComment(const std::string&) override;
//@}
//! @name Accessors
diff --git a/include/exiv2/rafimage.hpp b/include/exiv2/rafimage.hpp
index 5edd9460..799911c6 100644
--- a/include/exiv2/rafimage.hpp
+++ b/include/exiv2/rafimage.hpp
@@ -64,7 +64,7 @@ class EXIV2API RafImage : public Image {
@brief Not supported. RAF format does not contain a comment.
Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage).
*/
- void setComment(std::string_view comment) override;
+ void setComment(const std::string&) override;
//@}
//! @name Accessors
diff --git a/include/exiv2/rw2image.hpp b/include/exiv2/rw2image.hpp
index 63a94066..f26745ac 100644
--- a/include/exiv2/rw2image.hpp
+++ b/include/exiv2/rw2image.hpp
@@ -62,7 +62,7 @@ class EXIV2API Rw2Image : public Image {
@brief Not supported. RW2 format does not contain a comment.
Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage).
*/
- void setComment(std::string_view comment) override;
+ void setComment(const std::string&) override;
//@}
//! @name Accessors
diff --git a/include/exiv2/slice.hpp b/include/exiv2/slice.hpp
index 5cca6364..f278c7bc 100644
--- a/include/exiv2/slice.hpp
+++ b/include/exiv2/slice.hpp
@@ -263,7 +263,7 @@ struct ContainerStorage {
using const_iterator = typename container::const_iterator;
- using value_type = std::remove_cv_t;
+ using value_type = typename std::remove_cv::type;
/*!
* @throw std::out_of_range when end is larger than the container's
@@ -324,7 +324,7 @@ struct ContainerStorage {
*/
template
struct PtrSliceStorage {
- using value_type = std::remove_cv_t>;
+ using value_type = typename std::remove_cv::type>::type;
using iterator = value_type*;
using const_iterator = const value_type*;
@@ -423,7 +423,7 @@ struct Slice : public Internal::MutableSliceBase;
+ using value_type = typename std::remove_cv::type;
/*!
* @brief Construct a slice of the container `cont` starting at `begin`
@@ -476,7 +476,7 @@ struct Slice : public Internal::ConstSliceBase;
+ using value_type = typename std::remove_cv::type;
Slice(const container& cont, size_t begin, size_t end) :
Internal::ConstSliceBase(cont, begin, end) {
diff --git a/include/exiv2/tags.hpp b/include/exiv2/tags.hpp
index d043cca4..20f75212 100644
--- a/include/exiv2/tags.hpp
+++ b/include/exiv2/tags.hpp
@@ -30,12 +30,161 @@ using TagListFct = const TagInfo* (*)();
// *****************************************************************************
// class definitions
+//! Type to specify the IFD to which a metadata belongs
+enum class IfdId : uint32_t {
+ ifdIdNotSet,
+ ifd0Id,
+ ifd1Id,
+ ifd2Id,
+ ifd3Id,
+ exifId,
+ gpsId,
+ iopId,
+ mpfId,
+ subImage1Id,
+ subImage2Id,
+ subImage3Id,
+ subImage4Id,
+ subImage5Id,
+ subImage6Id,
+ subImage7Id,
+ subImage8Id,
+ subImage9Id,
+ subThumb1Id,
+ panaRawId,
+ mnId,
+ canonId,
+ canonAfCId,
+ canonAfMiAdjId,
+ canonAmId,
+ canonAsId,
+ canonCbId,
+ canonCiId,
+ canonCsId,
+ canonFilId,
+ canonFlId,
+ canonHdrId,
+ canonLeId,
+ canonMeId,
+ canonMoID,
+ canonMvId,
+ canonRawBId,
+ canonSiId,
+ canonCfId,
+ canonContrastId,
+ canonFcd1Id,
+ canonFcd2Id,
+ canonFcd3Id,
+ canonLiOpId,
+ canonMyColorID,
+ canonPiId,
+ canonPaId,
+ canonTiId,
+ canonFiId,
+ canonPrId,
+ canonPreID,
+ canonVigCorId,
+ canonVigCor2Id,
+ canonWbId,
+ casioId,
+ casio2Id,
+ fujiId,
+ minoltaId,
+ minoltaCs5DId,
+ minoltaCs7DId,
+ minoltaCsOldId,
+ minoltaCsNewId,
+ nikon1Id,
+ nikon2Id,
+ nikon3Id,
+ nikonPvId,
+ nikonVrId,
+ nikonPcId,
+ nikonWtId,
+ nikonIiId,
+ nikonAfId,
+ nikonAf21Id,
+ nikonAf22Id,
+ nikonAFTId,
+ nikonFiId,
+ nikonMeId,
+ nikonFl1Id,
+ nikonFl2Id,
+ nikonFl3Id,
+ nikonFl7Id,
+ nikonSi1Id,
+ nikonSi2Id,
+ nikonSi3Id,
+ nikonSi4Id,
+ nikonSi5Id,
+ nikonSi6Id,
+ nikonLd1Id,
+ nikonLd2Id,
+ nikonLd3Id,
+ nikonLd4Id,
+ nikonCb1Id,
+ nikonCb2Id,
+ nikonCb2aId,
+ nikonCb2bId,
+ nikonCb3Id,
+ nikonCb4Id,
+ olympusId,
+ olympus2Id,
+ olympusCsId,
+ olympusEqId,
+ olympusRdId,
+ olympusRd2Id,
+ olympusIpId,
+ olympusFiId,
+ olympusFe1Id,
+ olympusFe2Id,
+ olympusFe3Id,
+ olympusFe4Id,
+ olympusFe5Id,
+ olympusFe6Id,
+ olympusFe7Id,
+ olympusFe8Id,
+ olympusFe9Id,
+ olympusRiId,
+ panasonicId,
+ pentaxId,
+ pentaxDngId,
+ samsung2Id,
+ samsungPvId,
+ samsungPwId,
+ sigmaId,
+ sony1Id,
+ sony2Id,
+ sonyMltId,
+ sony1CsId,
+ sony1Cs2Id,
+ sony2CsId,
+ sony2Cs2Id,
+ sony2FpId,
+ sonyMisc1Id,
+ sonyMisc2bId,
+ sonyMisc3cId,
+ sonySInfo1Id,
+ sony2010eId,
+ sony1MltCs7DId,
+ sony1MltCsOldId,
+ sony1MltCsNewId,
+ sony1MltCsA100Id,
+ tagInfoMvId,
+ lastId,
+ ignoreId = lastId
+};
+
+inline std::ostream& operator<<(std::ostream& os, IfdId id) {
+ return os << static_cast(id);
+}
+
//! The details of an Exif group. Groups include IFDs and binary arrays.
struct EXIV2API GroupInfo {
struct GroupName;
- bool operator==(int ifdId) const; //!< Comparison operator for IFD id
+ bool operator==(IfdId ifdId) const; //!< Comparison operator for IFD id
bool operator==(const GroupName& groupName) const; //!< Comparison operator for group name
- int ifdId_; //!< IFD id
+ IfdId ifdId_; //!< IFD id
const char* ifdName_; //!< IFD name
const char* groupName_; //!< Group name, unique for each group.
TagListFct tagList_; //!< Tag list
@@ -47,18 +196,47 @@ struct EXIV2API GroupInfo::GroupName {
std::string g_; //!< Group name
};
+/*!
+ @brief Section identifiers to logically group tags. A section consists
+ of nothing more than a name, based on the Exif standard.
+ */
+enum class SectionId {
+ sectionIdNotSet,
+ imgStruct, // 4.6.4 A
+ recOffset, // 4.6.4 B
+ imgCharacter, // 4.6.4 C
+ otherTags, // 4.6.4 D
+ exifFormat, // 4.6.3
+ exifVersion, // 4.6.5 A
+ imgConfig, // 4.6.5 C
+ userInfo, // 4.6.5 D
+ relatedFile, // 4.6.5 E
+ dateTime, // 4.6.5 F
+ captureCond, // 4.6.5 G
+ gpsTags, // 4.6.6
+ iopTags, // 4.6.7
+ mpfTags,
+ makerTags, // MakerNote
+ dngTags, // DNG Spec
+ panaRaw,
+ tiffEp, // TIFF-EP Spec
+ tiffPm6,
+ adobeOpi,
+ lastSectionId
+};
+
//! Tag information
struct EXIV2API TagInfo {
- uint16_t tag_; //!< Tag
- const char* name_; //!< One word tag label
- const char* title_; //!< Tag title
- const char* desc_; //!< Short tag description
- int ifdId_; //!< Link to the (preferred) IFD
- int sectionId_; //!< Section id
- TypeId typeId_; //!< Type id
- int16_t count_; //!< The number of values (not bytes!), 0=any, -1=count not known.
- PrintFct printFct_; //!< Pointer to tag print function
-}; // struct TagInfo
+ uint16_t tag_; //!< Tag
+ const char* name_; //!< One word tag label
+ const char* title_; //!< Tag title
+ const char* desc_; //!< Short tag description
+ IfdId ifdId_; //!< Link to the (preferred) IFD
+ SectionId sectionId_; //!< Section id
+ TypeId typeId_; //!< Type id
+ int16_t count_; //!< The number of values (not bytes!), 0=any, -1=count not known.
+ PrintFct printFct_; //!< Pointer to tag print function
+}; // struct TagInfo
//! Access to Exif group and tag lists and misc. tag reference methods, implemented as a static class.
class EXIV2API ExifTags {
@@ -156,13 +334,12 @@ class EXIV2API ExifKey : public Key {
[[nodiscard]] std::string key() const override;
[[nodiscard]] const char* familyName() const override;
[[nodiscard]] std::string groupName() const override;
- //! Return the IFD id as an integer. (Do not use, this is meant for library internal use.)
- [[nodiscard]] int ifdId() const;
+ //! Return the IFD id. (Do not use, this is meant for library internal use.)
+ [[nodiscard]] IfdId ifdId() const;
[[nodiscard]] std::string tagName() const override;
[[nodiscard]] uint16_t tag() const override;
[[nodiscard]] std::string tagLabel() const override;
- //! Return the tag description.
- [[nodiscard]] std::string tagDesc() const; // Todo: should be in the base class
+ [[nodiscard]] std::string tagDesc() const override;
//! Return the default type id for this tag.
[[nodiscard]] TypeId defaultTypeId() const; // Todo: should be in the base class
diff --git a/include/exiv2/tgaimage.hpp b/include/exiv2/tgaimage.hpp
index 232addf3..7615280d 100644
--- a/include/exiv2/tgaimage.hpp
+++ b/include/exiv2/tgaimage.hpp
@@ -68,7 +68,7 @@ class EXIV2API TgaImage : public Image {
@brief Not supported. Calling this function will throw an instance
of Error(ErrorCode::kerInvalidSettingForImage).
*/
- void setComment(std::string_view comment) override;
+ void setComment(const std::string&) override;
//@}
//! @name Accessors
diff --git a/include/exiv2/tiffimage.hpp b/include/exiv2/tiffimage.hpp
index 121c9021..cdad720e 100644
--- a/include/exiv2/tiffimage.hpp
+++ b/include/exiv2/tiffimage.hpp
@@ -58,7 +58,7 @@ class EXIV2API TiffImage : public Image {
@brief Not supported. TIFF format does not contain a comment.
Calling this function will throw an Error(ErrorCode::kerInvalidSettingForImage).
*/
- void setComment(std::string_view comment) override;
+ void setComment(const std::string&) override;
//@}
//! @name Accessors
@@ -85,10 +85,10 @@ class EXIV2API TiffImage : public Image {
//@}
// DATA
- mutable std::string primaryGroup_; //!< The primary group
- mutable std::string mimeType_; //!< The MIME type
- mutable uint32_t pixelWidthPrimary_; //!< Width of the primary image in pixels
- mutable uint32_t pixelHeightPrimary_; //!< Height of the primary image in pixels
+ mutable std::string primaryGroup_; //!< The primary group
+ mutable std::string mimeType_; //!< The MIME type
+ mutable uint32_t pixelWidthPrimary_{0}; //!< Width of the primary image in pixels
+ mutable uint32_t pixelHeightPrimary_{0}; //!< Height of the primary image in pixels
}; // class TiffImage
diff --git a/include/exiv2/value.hpp b/include/exiv2/value.hpp
index c9c3830e..0121d18d 100644
--- a/include/exiv2/value.hpp
+++ b/include/exiv2/value.hpp
@@ -14,6 +14,7 @@
#include
#include
#include