sanity-io / sanity

Sanity Studio – Rapidly configure content workspaces powered by structured content
https://www.sanity.io
MIT License
5.27k stars 426 forks source link

Sanity changes hash for SVG images #3297

Open betalb opened 2 years ago

betalb commented 2 years ago

Describe the bug

Sanity does some manipulation with SVG images, causing them to change contents. For already optimised SVG image those manipulations look like attributes reordering. The problem is that this is causing hash change, so it is possible to do dataset export and then import without changing cdn image URL

To Reproduce

Steps to reproduce the behavior:

  1. Create a project with media plugin
  2. Upload SVG image original
  3. Download uploaded image downloaded
  4. Compare hashes

Expected behavior

I would expect that hashes match

Which versions of Sanity are you using?

@sanity/cli             2.30.0 (up to date)
@sanity/base            2.30.0 (up to date)
@sanity/cli             2.30.0 (up to date)
@sanity/core            2.30.0 (up to date)
@sanity/default-layout  2.30.0 (up to date)
@sanity/default-login   2.30.0 (up to date)
@sanity/desk-tool       2.30.0 (up to date)
@sanity/vision          2.30.0 (up to date)

Similar issue was reported earlier https://github.com/sanity-io/sanity/issues/2321

sourceful-david commented 2 years ago

We are also seeing this issue - it's causing inconsistencies across datasets that we export to