sharp icon indicating copy to clipboard operation
sharp copied to clipboard

(Auto) update image EXIF thumbnail after manipulation

Open jumpalottahigh opened this issue 4 years ago • 0 comments

What are you trying to achieve? Update an image's EXIF thumbnail after manipulation (in this case image auto rotation based on EXIF orientation).

Have you searched for similar feature requests? Yes, extensively. These are somewhat similar topics (but not quite): https://github.com/lovell/sharp/issues/650 https://github.com/lovell/sharp/issues/189

What would you expect the API to look like? Depending on how this is handled it could be either:

1) Sharp auto updates the image's EXIF thumbnail

2) On demand the user can update the EXIF thumbnail by:

const image = 'image.jpg'
const thumbnail = 'thumbnail.jpg' // file path, buffer or sharp

sharp(image)
    .withMetadata({
        ThumbnailImage: thumbnail
    })
    .toFile('image-with-updated-thumbnail.jpg')

Personally I think option 1) would be already enough to support most use cases, but having both might be the best case and does cover quite a wide range of scenarios where the user would just need a way to easily update the image's EXIF thumbnail.

Some examples of what the end goal is here:

  • user rotates an image and the EXIF thumbnail gets updated as well reflecting those changes
  • user composites images together and the EXIF thumbnail gets updated to reflect the changes

What alternatives have you considered? Outlined above.

Is there a sample image that helps explain? Not really, any image can be used to test this.

jumpalottahigh avatar Mar 09 '21 10:03 jumpalottahigh