diff options
Diffstat (limited to 'src/android/jpeg/exif.cpp')
-rw-r--r-- | src/android/jpeg/exif.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/android/jpeg/exif.cpp b/src/android/jpeg/exif.cpp index 3220b458..6b1d0f1f 100644 --- a/src/android/jpeg/exif.cpp +++ b/src/android/jpeg/exif.cpp @@ -430,16 +430,13 @@ void Exif::setOrientation(int orientation) setShort(EXIF_IFD_0, EXIF_TAG_ORIENTATION, value); } -/* - * The thumbnail data should remain valid until the Exif object is destroyed. - * Failing to do so, might result in no thumbnail data being set even after a - * call to Exif::setThumbnail(). - */ -void Exif::setThumbnail(Span<const unsigned char> thumbnail, +void Exif::setThumbnail(std::vector<unsigned char> &&thumbnail, Compression compression) { - data_->data = const_cast<unsigned char *>(thumbnail.data()); - data_->size = thumbnail.size(); + thumbnailData_ = std::move(thumbnail); + + data_->data = thumbnailData_.data(); + data_->size = thumbnailData_.size(); setShort(EXIF_IFD_0, EXIF_TAG_COMPRESSION, compression); } |