What are you trying to achieve?
Discard all existing metadata of an image and only write entries specified within withMetadata to the file. The current behavior merges existing entries with the new ones.
The striptag of libvips is !baton->withMetadatacontrolled by !baton->withMetadata. So might be difficult to combine strip and updating metadata together within libvips. Is there any other option instead encoding the image twice?
// My current workaround:sharp.prototype.discardMetadata=asyncfunction(){const{data, info}=awaitthis.raw().toBuffer({resolveWithObject: true});returnsharp(data,{raw: info});};
What are you trying to achieve?
Discard all existing metadata of an image and only write entries specified within
withMetadatato the file. The current behavior merges existing entries with the new ones.Have you searched for similar questions?
Sure at least: #650, #2724, #2812, #2638, #2507
The
striptag of libvips is!baton->withMetadatacontrolled by!baton->withMetadata. So might be difficult to combinestripand updating metadata together within libvips. Is there any other option instead encoding the image twice?Are you able to provide a minimal, standalone code sample that demonstrates this question?
Already exists, there you go: https://sharp.pixelplumbing.com/api-output#withmetadata
Are you able to provide a sample image that helps explain the question?
Not required.
The text was updated successfully, but these errors were encountered: