| 565 | } |
| 566 | |
| 567 | void Converter::cnvExifComment(const char* from, const char* to) { |
| 568 | auto pos = exifData_->findKey(ExifKey(from)); |
| 569 | if (pos == exifData_->end()) |
| 570 | return; |
| 571 | if (!prepareXmpTarget(to)) |
| 572 | return; |
| 573 | const auto cv = dynamic_cast<const CommentValue*>(&pos->value()); |
| 574 | if (!cv) { |
| 575 | #ifndef SUPPRESS_WARNINGS |
| 576 | EXV_WARNING << "Failed to convert " << from << " to " << to << "\n"; |
| 577 | #endif |
| 578 | return; |
| 579 | } |
| 580 | // Todo: Convert to UTF-8 if necessary |
| 581 | try { |
| 582 | (*xmpData_)[to] = cv->comment(); |
| 583 | } catch (const Error&) { |
| 584 | #ifndef SUPPRESS_WARNINGS |
| 585 | EXV_WARNING << "Failed to convert " << from << " to " << to << "\n"; |
| 586 | #endif |
| 587 | } |
| 588 | if (erase_) |
| 589 | exifData_->erase(pos); |
| 590 | } |
| 591 | |
| 592 | void Converter::cnvExifArray(const char* from, const char* to) { |
| 593 | auto pos = exifData_->findKey(ExifKey(from)); |