Project

General

Profile

RE: Setting meta data on a xmp sidecar image object (patc... ยป setmetadata_patch.diff

Matthias Baas, 27 Feb 2011 07:37

View differences:

src/image.cpp (Arbeitskopie)
119 119
#endif // EXV_HAVE_LIBZ
120 120
        { ImageType::pgf,  newPgfInstance,  isPgfType,  amReadWrite, amReadWrite, amReadWrite, amReadWrite },
121 121
        { ImageType::raf,  newRafInstance,  isRafType,  amRead,      amRead,      amRead,      amNone      },
122
        { ImageType::xmp,  newXmpInstance,  isXmpType,  amNone,      amNone,      amReadWrite, amNone      },
122
        { ImageType::xmp,  newXmpInstance,  isXmpType,  amReadWrite, amReadWrite, amReadWrite, amNone      },
123 123
        { ImageType::gif,  newGifInstance,  isGifType,  amNone,      amNone,      amNone,      amNone      },
124 124
        { ImageType::psd,  newPsdInstance,  isPsdType,  amRead,      amRead,      amRead,      amNone      },
125 125
        { ImageType::tga,  newTgaInstance,  isTgaType,  amNone,      amNone,      amNone,      amNone      },
......
187 187

  
188 188
    void Image::setMetadata(const Image& image)
189 189
    {
190
        setExifData(image.exifData());
191
        setIptcData(image.iptcData());
192
        setXmpPacket(image.xmpPacket());
193
        setXmpData(image.xmpData());
194
        setComment(image.comment());
190
        AccessMode am;
191

  
192
        // Set exif data...
193
        am = checkMode(mdExif);
194
        if (am==amWrite || am==amReadWrite)
195
        {
196
            setExifData(image.exifData());
197
        }
198
        // Set iptc data...
199
        am = checkMode(mdIptc);
200
        if (am==amWrite || am==amReadWrite)
201
        {
202
            setIptcData(image.iptcData());
203
        }
204
        // Set xmp data...
205
        am = checkMode(mdXmp);
206
        if (am==amWrite || am==amReadWrite)
207
        {
208
            setXmpPacket(image.xmpPacket());
209
            setXmpData(image.xmpData());
210
        }
211
        // Set the comment...
212
        am = checkMode(mdComment);
213
        if (am==amWrite || am==amReadWrite)
214
        {
215
            setComment(image.comment());
216
        }
195 217
    }
196 218

  
197 219
    void Image::clearExifData()
    (1-1/1)