Project

General

Profile

Patch #695 ยป src_metacopy.patch

Nikolai Saoukh, 13 Apr 2010 23:11

View differences:

src/metacopy.hpp (working copy)
40 40
    bool iptc_;                    //!< Iptc option flag.
41 41
    bool exif_;                    //!< Exif option flag.
42 42
    bool comment_;                 //!< JPEG comment option flag.
43
    bool xmp_;                     //!< XMP option flag.
43 44
    bool preserve_;                //!< Preserve existing metadata option flag.
44 45
    std::string read_;             //!< Source file
45 46
    std::string write_;            //!< Destination file
......
54 55
               iptc_(false),
55 56
               exif_(false),
56 57
               comment_(false),
58
               xmp_(false),
57 59
               preserve_(false)
58 60
        {}
59 61

  
src/metacopy.cpp (working copy)
74 74
    if (params.comment_) {
75 75
        writeImg->setComment(readImg->comment());
76 76
    }
77
    if (params.xmp_) {
78
        writeImg->setXmpData(readImg->xmpData());
79
    }
77 80

  
78 81
    try {
79 82
        writeImg->writeMetadata();
......
100 103
    case 'i': iptc_ = true; break;
101 104
    case 'e': exif_ = true; break;
102 105
    case 'c': comment_ = true; break;
106
    case 'x': xmp_ = true; break;
103 107
    case 'p': preserve_ = true; break;
104 108
    case 'a':
105 109
        iptc_ =true;
106 110
        exif_ =true;
107 111
        comment_ =true;
112
        xmp_ =true;
108 113
        break;
109 114
    case ':':
110 115
        std::cerr << progname() << ": Option -" << static_cast<char>(optopt)
......
152 157
            std::cerr << progname() << ": Write file must be specified\n";
153 158
            rc = 1;
154 159
        }
155
        if (preserve_ && iptc_ && exif_ && comment_ ) {
160
        if (preserve_ && iptc_ && exif_ && comment_ && xmp_ ) {
156 161
            std::cerr << progname() << ": Option -p has no effect when all metadata types are specified.\n";
157 162
            rc = 1;
158 163
        }
......
175 180
       << "   -i      Read Iptc data from readfile and write to writefile.\n"
176 181
       << "   -e      Read Exif data from readfile and write to writefile.\n"
177 182
       << "   -c      Read Jpeg comment from readfile and write to writefile.\n"
183
       << "   -x      Read XMP data from readfile and write to writefile.\n"
178 184
       << "   -a      Read all metadata from readfile and write to writefile.\n"
179 185
       << "   -p      Preserve existing metadata in writefile if not replaced.\n"
180 186
       << "   -h      Display this help and exit.\n\n";
    (1-1/1)