From c46b6ccb5e888f4343d0b9c3236ed565bfae9317 Mon Sep 17 00:00:00 2001 From: Kendaros <9271712+Kendaros@users.noreply.github.com> Date: Tue, 11 May 2021 11:42:31 +0200 Subject: [PATCH] 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. --- packages/strapi-plugin-upload/services/image-manipulation.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/strapi-plugin-upload/services/image-manipulation.js b/packages/strapi-plugin-upload/services/image-manipulation.js index eeb200a712..39c8c1a523 100644 --- a/packages/strapi-plugin-upload/services/image-manipulation.js +++ b/packages/strapi-plugin-upload/services/image-manipulation.js @@ -24,6 +24,7 @@ const THUMBNAIL_RESIZE_OPTIONS = { const resizeTo = (buffer, options) => sharp(buffer) + .withMetadata() .resize(options) .toBuffer() .catch(() => null);