| 842 | } // CrwMap::encode |
| 843 | |
| 844 | void CrwMap::encodeBasic(const Image& image, const CrwMapping* pCrwMapping, CiffHeader* pHead) { |
| 845 | // Determine the source Exif metadatum |
| 846 | ExifKey ek(pCrwMapping->tag_, Internal::groupName(pCrwMapping->ifdId_)); |
| 847 | auto ed = image.exifData().findKey(ek); |
| 848 | |
| 849 | // Set the new value or remove the entry |
| 850 | if (ed != image.exifData().end() && ed->size() > 0) { |
| 851 | DataBuf buf(ed->size()); |
| 852 | ed->copy(buf.data(), pHead->byteOrder()); |
| 853 | pHead->add(pCrwMapping->crwTagId_, pCrwMapping->crwDir_, std::move(buf)); |
| 854 | } else { |
| 855 | pHead->remove(pCrwMapping->crwTagId_, pCrwMapping->crwDir_); |
| 856 | } |
| 857 | } // CrwMap::encodeBasic |
| 858 | |
| 859 | void CrwMap::encode0x0805(const Image& image, const CrwMapping* pCrwMapping, CiffHeader* pHead) { |
| 860 | std::string comment = image.comment(); |