mirror of
https://github.com/strapi/strapi.git
synced 2025-11-02 02:44:55 +00:00
Keep metadata during resize images (#10161)
If the input file has EXIF, XMP, IPTC metadata (i.e user disabled "optimize size without quality loss" a.k.a "strip metadata" option in Admin UI), the resized images generated should keep metadata too. If the user doesn't want to keep metadata, they would let the default option "Optimize size without quality loss" enabled, right? So the resized images wouldn't keep the metadata anyway.
This commit is contained in:
parent
ae927f5b1f
commit
c46b6ccb5e
@ -24,6 +24,7 @@ const THUMBNAIL_RESIZE_OPTIONS = {
|
||||
|
||||
const resizeTo = (buffer, options) =>
|
||||
sharp(buffer)
|
||||
.withMetadata()
|
||||
.resize(options)
|
||||
.toBuffer()
|
||||
.catch(() => null);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user