Blame WORK-IN-PROGRESS

Packit Service 21b5d1
T A B L E   o f   C O N T E N T S
Packit Service 21b5d1
---------------------------------
Packit Service 21b5d1
Packit Service 21b5d1
1   Building Adobe XMPsdk and Samples in Terminal with the ./Generate_XXX_mac.sh scripts
Packit Service 21b5d1
1.1 Amazing Discovery 1    DumpFile is linked to libstdc++.6.dylib
Packit Service 21b5d1
1.2 Amazing Discovery 2    Millions of "weak symbol/visibility" messages
Packit Service 21b5d1
Packit Service 21b5d1
4   Build design for v0.26.1
Packit Service 21b5d1
4.8 Support for MinGW
Packit Service 21b5d1
Packit Service 21b5d1
5   Refactoring the Tiff Code
Packit Service 21b5d1
5.1 Background
Packit Service 21b5d1
5.2 How does Exiv2 decode the ExifData in a JPEG?
Packit Service 21b5d1
5.3 How is metadata organized in Exiv2
Packit Service 21b5d1
5.4 Where are the tags defined?
Packit Service 21b5d1
5.5 How do the MakerNotes get decoded?
Packit Service 21b5d1
5.6 How do the encoders work?
Packit Service 21b5d1
Packit Service 21b5d1
6   Using external XMP SDK via Conan
Packit Service 21b5d1
Packit Service 21b5d1
==========================================================================
Packit Service 21b5d1
Packit Service 21b5d1
4   Build design for v0.26.1
Packit Service 21b5d1
Packit Service 21b5d1
Added   : 2017-08-18
Packit Service 21b5d1
Modified: 2017-08-23
Packit Service 21b5d1
Packit Service 21b5d1
    The purpose of the v0.26.1 is to release bug fixes and
Packit Service 21b5d1
    experimental new features which may become defaults with v0.27
Packit Service 21b5d1
Packit Service 21b5d1
4.8 Support for MinGW
Packit Service 21b5d1
    MinGW msys/1.0 was deprecated when v0.26 was released.
Packit Service 21b5d1
    No support for MinGW msys/1.0 will be provided.
Packit Service 21b5d1
    It's very likely that the MinGW msys/1.0 will build.
Packit Service 21b5d1
    I will not provide any user support for MinGW msys/1.0 in future.
Packit Service 21b5d1
Packit Service 21b5d1
    MinGW msys/2.0 might be supported as "experimental" in Exiv2 v0.26.2
Packit Service 21b5d1
Packit Service 21b5d1
Packit Service 21b5d1
==========================================================================
Packit Service 21b5d1
Packit Service 21b5d1
5   Refactoring the Tiff Code
Packit Service 21b5d1
Packit Service 21b5d1
Added   : 2017-09-24
Packit Service 21b5d1
Modified: 2017-09-24
Packit Service 21b5d1
Packit Service 21b5d1
5.1 Background
Packit Service 21b5d1
    Tiff parsing is the root code of a metadata engine.
Packit Service 21b5d1
Packit Service 21b5d1
    The Tiff parsing code in Exiv2 is very difficult to understand and has major architectural shortcomings:
Packit Service 21b5d1
Packit Service 21b5d1
    1) It requires the Tiff file to be totally in memory
Packit Service 21b5d1
    2) It cannot handle BigTiff
Packit Service 21b5d1
    3) The parser doesn't know the source of the in memory tiff image
Packit Service 21b5d1
    4) It uses memory mapping on the tiff file
Packit Service 21b5d1
       - if the network connection is lost, horrible things happen
Packit Service 21b5d1
       - it requires a lot of VM to map the complete file
Packit Service 21b5d1
       - BigTiff file can be 100GB+
Packit Service 21b5d1
       - The memory mapping causes problems with Virus Detection software on Windows
Packit Service 21b5d1
    5) The parser cannot deal with multi-page tiff files
Packit Service 21b5d1
    6) It requires the total file to be in contiguous memory and defeats 'webready'.
Packit Service 21b5d1
Packit Service 21b5d1
    The Tiff parsing code in Exiv2 is ingenious.  It's also very robust.  It works well.  It can:
Packit Service 21b5d1
Packit Service 21b5d1
    1) Handle 32-bit Tiff and Many Raw formats (which are derived from Tiff)
Packit Service 21b5d1
    2) It can read and write Manufacturer's MakerNotes which are (mostly) in Tiff format
Packit Service 21b5d1
    3) It probably has other great features that I haven't discovered
Packit Service 21b5d1
       - because the code is so hard to understand, I can't simply browse and read it.
Packit Service 21b5d1
    4) It separates file navigation from data analysis.
Packit Service 21b5d1
Packit Service 21b5d1
    The code in image::printStructure was originally written to understand "what is a tiff?"
Packit Service 21b5d1
    It has problems:
Packit Service 21b5d1
    1) It was intended to be a single threaded debugging function and has security issues.
Packit Service 21b5d1
    2) It doesn't handle BigTiff
Packit Service 21b5d1
    3) It's messy.  It's reading and processing metadata simultaneously.
Packit Service 21b5d1
Packit Service 21b5d1
    The aim of this project is to
Packit Service 21b5d1
    1) Reconsider the Tiff Code.
Packit Service 21b5d1
    2) Keep everything good in the code and address known deficiencies
Packit Service 21b5d1
    3) Establish a Team Exiv2 "Tiff Expert" who knows the code intimately.
Packit Service 21b5d1
Packit Service 21b5d1
5.2 How does Exiv2 decode the ExifData in a JPEG?
Packit Service 21b5d1
    You can get my test file from http://clanmills.com/Stonehenge.jpg
Packit Service 21b5d1
Packit Service 21b5d1
    808 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2/build $ exiv2 -pS ~/Stonehenge.jpg
Packit Service 21b5d1
        STRUCTURE OF JPEG FILE: /Users/rmills/Stonehenge.jpg
Packit Service 21b5d1
         address | marker       |  length | data
Packit Service 21b5d1
               0 | 0xffd8 SOI
Packit Service 21b5d1
               2 | 0xffe1 APP1  |   15288 | Exif..II*......................
Packit Service 21b5d1
           15292 | 0xffe1 APP1  |    2610 | http://ns.adobe.com/xap/1.0/.
Packit Service 21b5d1
           17904 | 0xffed APP13 |      96 | Photoshop 3.0.8BIM.......'.....
Packit Service 21b5d1
           18002 | 0xffe2 APP2  |    4094 | MPF.II*...............0100.....
Packit Service 21b5d1
           22098 | 0xffdb DQT   |     132
Packit Service 21b5d1
           22232 | 0xffc0 SOF0  |      17
Packit Service 21b5d1
           22251 | 0xffc4 DHT   |     418
Packit Service 21b5d1
           22671 | 0xffda SOS
Packit Service 21b5d1
        809 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2/build $
Packit Service 21b5d1
Packit Service 21b5d1
    Exiv2 calls JpegBase::readMetadata which locates the APP1/Exif segment.
Packit Service 21b5d1
    It invokes the ExifParser:
Packit Service 21b5d1
       ExifParser::decode(exifData_, rawExif.pData_, rawExif.size_);
Packit Service 21b5d1
    This is thin wrapper over:
Packit Service 21b5d1
       TiffParserWorker::decode(....) in tiffimage.cpp
Packit Service 21b5d1
Packit Service 21b5d1
    What happens then?  I don't know.  The metadata is decoded in:
Packit Service 21b5d1
       tiffvisitor.cpp TiffDecoder::visitEntry()
Packit Service 21b5d1
Packit Service 21b5d1
    The design of the TiffMumble classes is the "Visitor" pattern
Packit Service 21b5d1
    described in "Design Patterns" by Addison & Wesley.  The aim of the pattern
Packit Service 21b5d1
    is to separate parsing from dealing with the data.
Packit Service 21b5d1
Packit Service 21b5d1
    The data is being stored in ExifData which is a vector.
Packit Service 21b5d1
    Order is important and preserved.
Packit Service 21b5d1
    As the data values are recovered they are stored as Exifdatum in the vector.
Packit Service 21b5d1
Packit Service 21b5d1
    How does the tiff visitor work?  I think the reader and processor
Packit Service 21b5d1
    are connected by this line in TiffParser::
Packit Service 21b5d1
        rootDir->accept(reader);
Packit Service 21b5d1
Packit Service 21b5d1
    The class tree for the decoder is:
Packit Service 21b5d1
Packit Service 21b5d1
    class TiffDecoder : public TiffFinder {
Packit Service 21b5d1
      class TiffReader ,
Packit Service 21b5d1
      class TiffFinder : public TiffVisitor {
Packit Service 21b5d1
        class TiffVisitor {
Packit Service 21b5d1
          public:
Packit Service 21b5d1
          //! Events for the stop/go flag. See setGo().
Packit Service 21b5d1
          enum GoEvent {
Packit Service 21b5d1
              geTraverse       = 0,
Packit Service 21b5d1
              geKnownMakernote = 1
Packit Service 21b5d1
          };
Packit Service 21b5d1
Packit Service 21b5d1
          void setGo(GoEvent event, bool go);
Packit Service 21b5d1
          virtual void visitEntry(TiffEntry* object) =0;
Packit Service 21b5d1
          virtual void visitDataEntry(TiffDataEntry* object) =0;
Packit Service 21b5d1
          virtual void visitImageEntry(TiffImageEntry* object) =0;
Packit Service 21b5d1
          virtual void visitSizeEntry(TiffSizeEntry* object) =0;
Packit Service 21b5d1
          virtual void visitDirectory(TiffDirectory* object) =0;
Packit Service 21b5d1
          virtual void visitSubIfd(TiffSubIfd* object) =0;
Packit Service 21b5d1
          virtual void visitMnEntry(TiffMnEntry* object) =0;
Packit Service 21b5d1
          virtual void visitIfdMakernote(TiffIfdMakernote* object) =0;
Packit Service 21b5d1
          virtual void visitIfdMakernoteEnd(TiffIfdMakernote* object);
Packit Service 21b5d1
          virtual void visitBinaryArray(TiffBinaryArray* object) =0;
Packit Service 21b5d1
          virtual void visitBinaryArrayEnd(TiffBinaryArray* object);
Packit Service 21b5d1
          //! Operation to perform for an element of a binary array
Packit Service 21b5d1
          virtual void visitBinaryElement(TiffBinaryElement* object) =0;
Packit Service 21b5d1
Packit Service 21b5d1
          //! Check if stop flag for \em event is clear, return true if it's clear.
Packit Service 21b5d1
          bool go(GoEvent event) const;
Packit Service 21b5d1
        }
Packit Service 21b5d1
      }
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
    The reader works by stepping along the Tiff directory and calls the visitor's
Packit Service 21b5d1
    "callbacks" as it reads.
Packit Service 21b5d1
Packit Service 21b5d1
    There are 2000 lines of code in tiffcomposite.cpp and, to be honest,
Packit Service 21b5d1
    I don't know what most of it does!
Packit Service 21b5d1
Packit Service 21b5d1
    Set a breakpoint in src/exif.cpp#571.
Packit Service 21b5d1
    That’s where he adds the key/value to the exifData vector.
Packit Service 21b5d1
    Exactly how did he get here?  That’s a puzzle.
Packit Service 21b5d1
Packit Service 21b5d1
    void ExifData::add(const ExifKey& key, const Value* pValue)
Packit Service 21b5d1
    {
Packit Service 21b5d1
        add(Exifdatum(key, pValue));
Packit Service 21b5d1
    }
Packit Service 21b5d1
Packit Service 21b5d1
5.3 How is metadata organized in Exiv2
Packit Service 21b5d1
    section.group.tag
Packit Service 21b5d1
Packit Service 21b5d1
    section: Exif | IPTC | Xmp
Packit Service 21b5d1
    group:   Photo | Image | MakerNote | Nikon3 ....
Packit Service 21b5d1
    tag: YResolution etc ...
Packit Service 21b5d1
Packit Service 21b5d1
    820 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2/src $ exiv2 -pa ~/Stonehenge.jpg | cut -d' ' -f 1 | cut -d. -f 1 | sort | uniq
Packit Service 21b5d1
    Exif
Packit Service 21b5d1
    Iptc
Packit Service 21b5d1
    Xmp
Packit Service 21b5d1
Packit Service 21b5d1
    821 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2/src $ exiv2 -pa --grep Exif ~/Stonehenge.jpg  | cut -d'.' -f 2 | sort | uniq
Packit Service 21b5d1
    GPSInfo
Packit Service 21b5d1
    Image
Packit Service 21b5d1
    Iop
Packit Service 21b5d1
    MakerNote
Packit Service 21b5d1
    Nikon3
Packit Service 21b5d1
    NikonAf2
Packit Service 21b5d1
    NikonCb2b
Packit Service 21b5d1
    NikonFi
Packit Service 21b5d1
    NikonIi
Packit Service 21b5d1
    NikonLd3
Packit Service 21b5d1
    NikonMe
Packit Service 21b5d1
    NikonPc
Packit Service 21b5d1
    NikonVr
Packit Service 21b5d1
    NikonWt
Packit Service 21b5d1
    Photo
Packit Service 21b5d1
    Thumbnail
Packit Service 21b5d1
Packit Service 21b5d1
    822 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2/src $ 533 rmills@rmillsmbp:~/Downloads $ exiv2 -pa --grep Exif ~/Stonehenge.jpg  | cut -d'.' -f 3 | cut -d' ' -f 1 | sort | uniq
Packit Service 21b5d1
    AFAperture
Packit Service 21b5d1
    AFAreaHeight
Packit Service 21b5d1
    AFAreaMode
Packit Service 21b5d1
    ...
Packit Service 21b5d1
    XResolution
Packit Service 21b5d1
    YCbCrPositioning
Packit Service 21b5d1
    YResolution
Packit Service 21b5d1
534 rmills@rmillsmbp:~/Downloads $
Packit Service 21b5d1
    823 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2/src $
Packit Service 21b5d1
Packit Service 21b5d1
    The data in IFD0 of is Exiv2.Image:
Packit Service 21b5d1
Packit Service 21b5d1
    826 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2/src $ exiv2 -pR ~/Stonehenge.jpg  | head -20
Packit Service 21b5d1
    STRUCTURE OF JPEG FILE: /Users/rmills/Stonehenge.jpg
Packit Service 21b5d1
     address | marker       |  length | data
Packit Service 21b5d1
           0 | 0xffd8 SOI
Packit Service 21b5d1
           2 | 0xffe1 APP1  |   15288 | Exif..II*......................
Packit Service 21b5d1
      STRUCTURE OF TIFF FILE (II): MemIo
Packit Service 21b5d1
       address |    tag                              |      type |    count |    offset | value
Packit Service 21b5d1
            10 | 0x010f Make                         |     ASCII |       18 |       146 | NIKON CORPORATION
Packit Service 21b5d1
            22 | 0x0110 Model                        |     ASCII |       12 |       164 | NIKON D5300
Packit Service 21b5d1
            34 | 0x0112 Orientation                  |     SHORT |        1 |           | 1
Packit Service 21b5d1
            46 | 0x011a XResolution                  |  RATIONAL |        1 |       176 | 300/1
Packit Service 21b5d1
            58 | 0x011b YResolution                  |  RATIONAL |        1 |       184 | 300/1
Packit Service 21b5d1
            70 | 0x0128 ResolutionUnit               |     SHORT |        1 |           | 2
Packit Service 21b5d1
            82 | 0x0131 Software                     |     ASCII |       10 |       192 | Ver.1.00
Packit Service 21b5d1
            94 | 0x0132 DateTime                     |     ASCII |       20 |       202 | 2015:07:16 20:25:28
Packit Service 21b5d1
           106 | 0x0213 YCbCrPositioning             |     SHORT |        1 |           | 1
Packit Service 21b5d1
           118 | 0x8769 ExifTag                      |      LONG |        1 |           | 222
Packit Service 21b5d1
        STRUCTURE OF TIFF FILE (II): MemIo
Packit Service 21b5d1
         address |    tag                              |      type |    count |    offset | value
Packit Service 21b5d1
             224 | 0x829a ExposureTime                 |  RATIONAL |        1 |       732 | 10/4000
Packit Service 21b5d1
             236 | 0x829d FNumber                      |  RATIONAL |        1 |       740 | 100/10
Packit Service 21b5d1
    827 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2/src $ exiv2 -pa --grep Image ~/Stonehenge.jpg
Packit Service 21b5d1
    Exif.Image.Make                              Ascii      18  NIKON CORPORATION
Packit Service 21b5d1
    Exif.Image.Model                             Ascii      12  NIKON D5300
Packit Service 21b5d1
    Exif.Image.Orientation                       Short       1  top, left
Packit Service 21b5d1
    Exif.Image.XResolution                       Rational    1  300
Packit Service 21b5d1
    Exif.Image.YResolution                       Rational    1  300
Packit Service 21b5d1
    Exif.Image.ResolutionUnit                    Short       1  inch
Packit Service 21b5d1
    Exif.Image.Software                          Ascii      10  Ver.1.00
Packit Service 21b5d1
    Exif.Image.DateTime                          Ascii      20  2015:07:16 20:25:28
Packit Service 21b5d1
    Exif.Image.YCbCrPositioning                  Short       1  Centered
Packit Service 21b5d1
    Exif.Image.ExifTag                           Long        1  222
Packit Service 21b5d1
    Exif.Nikon3.ImageBoundary                    Short       4  0 0 6000 4000
Packit Service 21b5d1
    Exif.Nikon3.ImageDataSize                    Long        1  6173648
Packit Service 21b5d1
    Exif.NikonAf2.AFImageWidth                   Short       1  0
Packit Service 21b5d1
    Exif.NikonAf2.AFImageHeight                  Short       1  0
Packit Service 21b5d1
    Exif.Photo.ImageUniqueID                     Ascii      33  090caaf2c085f3e102513b24750041aa
Packit Service 21b5d1
    Exif.Image.GPSTag                            Long        1  4060
Packit Service 21b5d1
    828 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2/src $
Packit Service 21b5d1
Packit Service 21b5d1
    The data in IFD1 is Exiv2.Photo
Packit Service 21b5d1
Packit Service 21b5d1
    The data in the MakerNote is another embedded TIFF (which more embedded tiffs)
Packit Service 21b5d1
Packit Service 21b5d1
    829 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2/src $ exiv2 -pa --grep MakerNote ~/Stonehenge.jpg
Packit Service 21b5d1
    Exif.Photo.MakerNote                         Undefined 3152  (Binary value suppressed)
Packit Service 21b5d1
    Exif.MakerNote.Offset                        Long        1  914
Packit Service 21b5d1
    Exif.MakerNote.ByteOrder                     Ascii       3  II
Packit Service 21b5d1
    830 rmills@rmillsmbp:~/gnu/github/exiv2/exiv2/src $
Packit Service 21b5d1
Packit Service 21b5d1
    The MakerNote decodes them into:
Packit Service 21b5d1
Packit Service 21b5d1
    Exif.Nikon1, Exiv2.NikonAf2 and so on.  I don't know exactly it achieves this.
Packit Service 21b5d1
    However it means that tag-numbers can be reused in different IFDs.
Packit Service 21b5d1
    Tag 0x0016 = Nikon GPSSpeed and can mean something different elsewhere.
Packit Service 21b5d1
Packit Service 21b5d1
5.4 Where are the tags defined?
Packit Service 21b5d1
Packit Service 21b5d1
    There's an array of "TagInfo" data structures in each of the makernote decoders.
Packit Service 21b5d1
    These define the tag (a number) and the tag name, the groupID (eg canonId) and the default type.
Packit Service 21b5d1
    There's also a callback to print the value of the tag.  This does the "interpretation"
Packit Service 21b5d1
    that is performed by the -pt in the exiv2 command-line program.
Packit Service 21b5d1
Packit Service 21b5d1
    TagInfo(0x4001, "ColorData", N_("Color Data"), N_("Color data"), canonId, makerTags, unsignedShort, -1, printValue),
Packit Service 21b5d1
Packit Service 21b5d1
5.5 How do the MakerNotes get decoded?
Packit Service 21b5d1
Packit Service 21b5d1
    I don't know.  It has something to do with this code in tiffcomposite.cpp#936
Packit Service 21b5d1
Packit Service 21b5d1
    TiffMnEntry::doAccept(TiffVisitor& visitor) { ... }
Packit Service 21b5d1
Packit Service 21b5d1
    Most makernotes are TiffStructures.  So the TiffXXX classes are invoked recursively to decode the maker note.
Packit Service 21b5d1
Packit Service 21b5d1
#0	0x000000010058b4b0 in Exiv2::Internal::TiffDirectory::doAccept(Exiv2::Internal::TiffVisitor&) at /Users/rmills/gnu/github/exiv2/exiv2/src/tiffcomposite.cpp:916
Packit Service 21b5d1
    This function iterated the array of entries
Packit Service 21b5d1
Packit Service 21b5d1
#1	0x000000010058b3c6 in Exiv2::Internal::TiffComponent::accept(Exiv2::Internal::TiffVisitor&) at /Users/rmills/gnu/github/exiv2/exiv2/src/tiffcomposite.cpp:891
Packit Service 21b5d1
#2	0x00000001005b5357 in Exiv2::Internal::TiffParserWorker::parse(unsigned char const*, unsigned int, unsigned int, Exiv2::Internal::TiffHeaderBase*) at /Users/rmills/gnu/github/exiv2/exiv2/src/tiffimage.cpp:2006
Packit Service 21b5d1
    This function creates an array of TiffEntries
Packit Service 21b5d1
Packit Service 21b5d1
#3	0x00000001005a2a60 in Exiv2::Internal::TiffParserWorker::decode(Exiv2::ExifData&, Exiv2::IptcData&, Exiv2::XmpData&, unsigned char const*, unsigned int, unsigned int, void (Exiv2::Internal::TiffDecoder::* (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, Exiv2::Internal::IfdId))(Exiv2::Internal::TiffEntryBase const*), Exiv2::Internal::TiffHeaderBase*) at /Users/rmills/gnu/github/exiv2/exiv2/src/tiffimage.cpp:1900
Packit Service 21b5d1
#4	0x00000001005a1ae9 in Exiv2::TiffParser::decode(Exiv2::ExifData&, Exiv2::IptcData&, Exiv2::XmpData&, unsigned char const*, unsigned int) at /Users/rmills/gnu/github/exiv2/exiv2/src/tiffimage.cpp:260
Packit Service 21b5d1
#5	0x000000010044d956 in Exiv2::ExifParser::decode(Exiv2::ExifData&, unsigned char const*, unsigned int) at /Users/rmills/gnu/github/exiv2/exiv2/src/exif.cpp:625
Packit Service 21b5d1
#6	0x0000000100498fd7 in Exiv2::JpegBase::readMetadata() at /Users/rmills/gnu/github/exiv2/exiv2/src/jpgimage.cpp:386
Packit Service 21b5d1
#7	0x000000010000bc59 in Action::Print::printList() at /Users/rmills/gnu/github/exiv2/exiv2/src/actions.cpp:530
Packit Service 21b5d1
#8	0x0000000100005835 in Action::Print::run(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) at /Users/rmills/gnu/github/exiv2/exiv2/src/actions.cpp:245
Packit Service 21b5d1
Packit Service 21b5d1
Packit Service 21b5d1
5.6 How do the encoders work?
Packit Service 21b5d1
Packit Service 21b5d1
    I understand writeMetadata() and will document that soon.
Packit Service 21b5d1
    I still have to study how the TiffVisitor writes metadata.
Packit Service 21b5d1
Packit Service 21b5d1
Packit Service 21b5d1
6   Using external XMP SDK via Conan
Packit Service 21b5d1
Packit Service 21b5d1
Section 1 describes how to compile the newer versions of XMP SDK with a bash script. This
Packit Service 21b5d1
approach had few limitations:
Packit Service 21b5d1
Packit Service 21b5d1
    1) We had to include sources from other projects into the Exiv2 repository: Check the folder
Packit Service 21b5d1
    xmpsdk/third-party.
Packit Service 21b5d1
    2) Different scripts for compiling XMP SDK on Linux, Mac OSX and Windows.
Packit Service 21b5d1
    3) Lot of configuration/compilation issues depending on the system configuration.
Packit Service 21b5d1
Packit Service 21b5d1
Taking into account that during the last months we have done a big effort in migrating the
Packit Service 21b5d1
manipulation of 3rd party dependencies to Conan, we have decided to do the same here. A conan recipe
Packit Service 21b5d1
has been written for XmpSdk at:
Packit Service 21b5d1
Packit Service 21b5d1
https://github.com/piponazo/conan-xmpsdk
Packit Service 21b5d1
Packit Service 21b5d1
And the recipe and package binaries can be found in the piponazo's bintray repository:
Packit Service 21b5d1
Packit Service 21b5d1
https://bintray.com/piponazo/piponazo
Packit Service 21b5d1
Packit Service 21b5d1
This conan recipe provides a custom CMake finder that will be used by our CMake code to properly
Packit Service 21b5d1
find XMP SDK in the conan cache and then be able to use the CMake variables: ${XMPSDK_LIBRARY} and
Packit Service 21b5d1
${XMPSDK_INCLUDE_DIR}.
Packit Service 21b5d1
Packit Service 21b5d1
These are the steps you will need to follow to configure the project with the external XMP support:
Packit Service 21b5d1
Packit Service 21b5d1
    # Add the conan-piponazo remote to your conan configuration (only once)
Packit Service 21b5d1
    conan remote add conan-piponazo https://api.bintray.com/conan/piponazo/piponazo 
Packit Service 21b5d1
Packit Service 21b5d1
    mkdir build && cd build
Packit Service 21b5d1
Packit Service 21b5d1
    # Run conan to bring the dependencies. Note that the XMPSDK is not enabled by default and you will
Packit Service 21b5d1
    # need to enable the xmp option to bring it.
Packit Service 21b5d1
    conan install .. --options xmp=True
Packit Service 21b5d1
Packit Service 21b5d1
    # Configure the project with support for the external XMP version. Disable the normal XMP version
Packit Service 21b5d1
    cmake -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_XMP=OFF -DEXIV2_ENABLE_EXTERNAL_XMP=ON -DBUILD_SHARED_LIBS=ON ..
Packit Service 21b5d1
Packit Service 21b5d1
Note that the usage of the newer versions of XMP is experimental and it was included in Exiv2
Packit Service 21b5d1
because few users has requested it.