Integrate the sharp withMetadata option #2586
STR1234
started this conversation in
Feature Requests & Ideas
Replies: 1 comment
-
I think it would be very nice to have a option to keep image metadata, even google recommends it for image licensing: https://developers.google.com/search/docs/appearance/structured-data/image-license-metadata |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
it would be nice to have the option to keep the image metadata when formatting with sharp.
Currently my problem is when I download an already formatted image from the CMS and try to
reupload that specific file I get a:
ValidationError: assets validation failed: height: Cast to Number failed for value "NaN" (type number) at path "height"
The upload collection in my case has a formatOption of webP and a specified width but I give it an undefined height so
that it calculates that itself and keeps the aspect ratio.
I am guessing that it has something to do with the stripped out metadata after formatting. <- After some more testing this does not seem to actually be the culprit here.
However keeping the metadata of formatted images can still be useful to be able to keep orientation information that is saved in the metadata. We sometimes have images that were edited and reoriented saving the new orientation information only in the metadata.
When sharp now strips out that information the image appears sideways.
In these cases keeping the metadata should prevent losing the orientation information and displaying the image correctly oriented after processing it through sharp in payload.
As sharp provides the option to keep metadata through "withMetdata()" it would be great if we could make use of that
option in the upload field.
What do you think? Am I mssing something and this issue is not actually related to the stripped metadata? :P (Yes the issue seems not to be related to the metadata...at least not directly - but still the withMetadata option could make a lot of sense in my opinion)
Beta Was this translation helpful? Give feedback.
All reactions