diff --git a/Makefile b/Makefile index 0e1d2bae..8642dee9 100644 --- a/Makefile +++ b/Makefile @@ -101,7 +101,8 @@ bugtest bugstest testbugs bugfixes: addmoddel exifcomment exifvalue httptest iptctest mmap-test stringto-test \ exifdata iotest key-test path-test taglist write2-test write-test \ convert-test exifdata-test exiv2json iptceasy largeiptc-test prevtest tiff-test \ -easyaccess-test geotag iptcprint metacopy werror-test xmpparser-test xmpsample xmpparse : +easyaccess-test geotag iptcprint metacopy toexv werror-test \ +xmpparser-test xmpsample xmpparse : cd samples && $(MAKE) $(MAKECMDGOALS) MAJOR=$(shell grep "define.*EXIV2_.*_VERSION .*\\d*" src/version.hpp | grep MAJOR | sed -e 's/EXIV2//g' | tr -dC [:digit:]) diff --git a/config/Makefile.in b/config/Makefile.in index 38c0754d..dfa1f31e 100644 --- a/config/Makefile.in +++ b/config/Makefile.in @@ -101,7 +101,8 @@ bugtest bugstest testbugs bugfixes: addmoddel exifcomment exifvalue httptest iptctest mmap-test stringto-test \ exifdata iotest key-test path-test taglist write2-test write-test \ convert-test exifdata-test exiv2json iptceasy largeiptc-test prevtest tiff-test \ -easyaccess-test geotag iptcprint metacopy werror-test xmpparser-test xmpsample xmpparse : +easyaccess-test geotag iptcprint metacopy toexv werror-test \ +xmpparser-test xmpsample xmpparse : cd samples && $(MAKE) $(MAKECMDGOALS) MAJOR=$(shell grep "define.*EXIV2_.*_VERSION .*\\d*" src/version.hpp | grep MAJOR | sed -e 's/EXIV2//g' | tr -dC [:digit:]) diff --git a/include/exiv2/image.hpp b/include/exiv2/image.hpp index 3ed99320..495ab5c7 100644 --- a/include/exiv2/image.hpp +++ b/include/exiv2/image.hpp @@ -235,10 +235,15 @@ namespace Exiv2 { */ virtual void setIccProfile(DataBuf& iccProfile); /*! - @brief Erase iccProfile. the profile isnot not removed from + @brief Erase iccProfile. the profile is not removed from the actual image until the writeMetadata() method is called. */ virtual void clearIccProfile(); + + /*! + @brief return iccProfile + */ + virtual DataBuf* iccProfile() { return &iccProfile_; } /*! @brief Copy all existing metadata from source Image. The data is copied into internal buffers and is not written to the image diff --git a/include/exiv2/types.hpp b/include/exiv2/types.hpp index 00c225b5..c22b71c9 100644 --- a/include/exiv2/types.hpp +++ b/include/exiv2/types.hpp @@ -112,7 +112,7 @@ namespace Exiv2 { enum WriteMethod { wmIntrusive, wmNonIntrusive }; //! An identifier for each type of metadata - enum MetadataId { mdNone=0, mdExif=1, mdIptc=2, mdComment=4, mdXmp=8 }; + enum MetadataId { mdNone=0, mdExif=1, mdIptc=2, mdComment=4, mdXmp=8, mdIccProfile=16 }; //! An identifier for each mode of metadata support enum AccessMode { amNone=0, amRead=1, amWrite=2, amReadWrite=3 }; diff --git a/samples/Makefile b/samples/Makefile index c3ca6512..805b95ea 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -87,7 +87,8 @@ BINSRC = addmoddel.cpp \ OTHERSRC = exiv2json.cpp \ geotag.cpp \ metacopy.cpp \ - path-test.cpp + path-test.cpp \ + toexv.cpp # ****************************************************************************** # Initialisations @@ -167,7 +168,7 @@ geotag: %: %.cpp $(LIBTOOL) --mode=link $(LINK.cc) -lexpat $@.o -o ../bin/$@ # link applications which require utils.cpp support -metacopy path-test: %: %.cpp ../src/utils.o +metacopy path-test toexv: %: %.cpp ../src/utils.o $(COMPILE.cc) -I../src -I../include -I../include/exiv2 -o $@.o $< @$(MAKEDEPEND) @$(POSTDEPEND) diff --git a/src/image.cpp b/src/image.cpp index eceaf743..7f048710 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -212,6 +212,9 @@ namespace Exiv2 { if (checkMode(mdIptc) & amWrite) { setIptcData(image.iptcData()); } + if (checkMode(mdIccProfile) & amWrite && iccProfile()) { + setIccProfile(*iccProfile()); + } if (checkMode(mdXmp) & amWrite) { setXmpPacket(image.xmpPacket()); setXmpData(image.xmpData()); @@ -391,6 +394,8 @@ namespace Exiv2 { case mdComment: am = r->commentSupport_; break; + case mdIccProfile: break; + // no default: let the compiler complain } return am;