| 759 | } // TiffEncoder::encodeArrayElement |
| 760 | |
| 761 | void TiffEncoder::encodeDataEntry(TiffDataEntry* object, const Exifdatum* datum) { |
| 762 | encodeOffsetEntry(object, datum); |
| 763 | |
| 764 | if (!dirty_ && writeMethod() == wmNonIntrusive) { |
| 765 | if (object->sizeDataArea_ < object->pValue()->sizeDataArea()) { |
| 766 | #ifdef EXIV2_DEBUG_MESSAGES |
| 767 | ExifKey key(object->tag(), groupName(object->group())); |
| 768 | std::cerr << "DATAAREA GREW " << key << "\n"; |
| 769 | #endif |
| 770 | setDirty(); |
| 771 | } else { |
| 772 | // Write the new dataarea, fill with 0x0 |
| 773 | #ifdef EXIV2_DEBUG_MESSAGES |
| 774 | ExifKey key(object->tag(), groupName(object->group())); |
| 775 | std::cerr << "Writing data area for " << key << "\n"; |
| 776 | #endif |
| 777 | DataBuf buf = object->pValue()->dataArea(); |
| 778 | if (!buf.empty()) { |
| 779 | memcpy(object->pDataArea_, buf.c_data(), buf.size()); |
| 780 | if (object->sizeDataArea_ > buf.size()) { |
| 781 | memset(object->pDataArea_ + buf.size(), 0x0, object->sizeDataArea_ - buf.size()); |
| 782 | } |
| 783 | } |
| 784 | } |
| 785 | } |
| 786 | |
| 787 | } // TiffEncoder::encodeDataEntry |
| 788 | |
| 789 | void TiffEncoder::encodeTiffEntry(TiffEntry* object, const Exifdatum* datum) { |
| 790 | encodeTiffEntryBase(object, datum); |