|
120 | 120 | (txexpr (string->symbol type) attr-lst (list elems)))]
|
121 | 121 | ; attr stuff
|
122 | 122 | [("xmp:BaseURL" "xmp:Label" "xmp:Rating")
|
123 |
| - (define xexpr (string->xexpr (image-xmp))) |
| 123 | + (define xexpr (string->xexpr (if (empty? (image-xmp)) |
| 124 | + "" |
| 125 | + (first (image-xmp))))) |
124 | 126 | ; these go inside rdf:Description as attrs
|
125 | 127 | (define rdf:desc (findf-txexpr xexpr is-rdf:Description?))
|
126 | 128 | (attr-set rdf:desc (string->symbol type) elems)]
|
|
135 | 137 | (case type
|
136 | 138 | [("xmp:BaseURL" "xmp:Label" "xmp:Rating")
|
137 | 139 | ((set-xmp-tag 'rdf:Description)
|
138 |
| - (string->xexpr (image-xmp)) |
| 140 | + (string->xexpr (if (empty? (image-xmp)) |
| 141 | + "" |
| 142 | + (first (image-xmp)))) |
139 | 143 | (create-dc-meta type elems attrs))]
|
140 | 144 | [else
|
141 | 145 | ((set-xmp-tag (string->symbol type))
|
142 |
| - (string->xexpr (first (image-xmp))) |
| 146 | + (string->xexpr (if (empty? (image-xmp)) |
| 147 | + "" |
| 148 | + (first (image-xmp)))) |
143 | 149 | (create-dc-meta type elems attrs))]))
|
144 |
| - (image-xmp (xexpr->string setted)) |
145 |
| - (set-embed-xmp! (image-path) (image-xmp)) |
| 150 | + (image-xmp (list (xexpr->string setted))) |
| 151 | + (set-embed-xmp! (image-path) (first (image-xmp))) |
146 | 152 | (fields-defaults))
|
147 | 153 |
|
148 | 154 | (define (fields-defaults)
|
|
169 | 175 | (define dc-choice
|
170 | 176 | (new choice%
|
171 | 177 | [parent dc-hpanel]
|
172 |
| - [label "XMP Tags "] |
| 178 | + [label "XMP Tags "] |
173 | 179 | [choices (append dublin-core xmp-base)]
|
174 | 180 | [selection 11]
|
175 | 181 | [stretchable-height #f]
|
176 | 182 | [callback
|
177 | 183 | (λ (choice evt)
|
178 | 184 | ; when the choice is selected, fill the tfield with its contents
|
179 | 185 | (define sel (string->symbol (send choice get-string-selection)))
|
180 |
| - (define xexpr (string->xexpr (image-xmp))) |
| 186 | + (define xexpr (string->xexpr (if (empty? (image-xmp)) |
| 187 | + "" |
| 188 | + (first (image-xmp))))) |
181 | 189 | (define found (findf*-txexpr xexpr (is-tag? sel)))
|
182 | 190 | (cond [found
|
183 | 191 | (case sel
|
|
230 | 238 | (define attr-choice
|
231 | 239 | (new choice%
|
232 | 240 | [parent attr-hpanel]
|
233 |
| - [label "Attribute val "] |
| 241 | + [label "Attribute val "] |
234 | 242 | [choices attrs]
|
235 | 243 | [selection 0]
|
236 | 244 | [stretchable-height #f]))
|
|
0 commit comments