Allow preserving image metadata when using Astro components #1251
DavidOsipov
started this conversation in
Proposal
Replies: 0 comments
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.
-
Summary
Add a simple config option to
astro.config.mjsto let users keep image metadata (XMP, EXIF, etc.) when using the built-in<Image>and<Picture>components.Background & Motivation
Right now, when Astro processes images, it strips all the useful metadata. This is a problem because this metadata is not just junk data; it is important for many real-world reasons:
The only way to fix this today is to build a whole custom image service just to add one function call (
.keepMetadata()). This is too much work for something that should be a simple switch. We are forced to do a lot of complex setup for a very common need.Goals
Example
I propose adding a new boolean option to the
imageconfig inastro.config.mjs.Let's call it
preserveMetadata.When
preserveMetadatais set totrue, Astro would simply tell the underlying Sharp service to use its.keepMetadata()function. This would preserve all existing metadata from the source image in the final output.The default should be
falseto avoid changing the current behavior for existing projects. This makes it a non-breaking, opt-in feature.Beta Was this translation helpful? Give feedback.
All reactions