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:
Kendaros 2021-05-11 11:42:31 +02:00 committed by GitHub
parent ae927f5b1f
commit c46b6ccb5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,7 @@ const THUMBNAIL_RESIZE_OPTIONS = {
const resizeTo = (buffer, options) =>
sharp(buffer)
.withMetadata()
.resize(options)
.toBuffer()
.catch(() => null);