wellcomecollection / wellcomecollection.org

🪟 Wellcome Collection's website and services that support it
https://wellcomecollection.org
MIT License
37 stars 5 forks source link

Prismic; image dimensions not being queried properly? #10853

Open rcantin-w opened 2 months ago

rcantin-w commented 2 months ago

We'd noticed images dimensions were a bit off following the content migration, for example in search they should all be the same format but aren't anymore:

Image

Then e2e tests flagged that the expected URL for an image wasn't right:


Expected string: "https://images.prismic.io/wellcomecollection/2a42de1c-7954-4ece-be5f-775079c4bc54_Lauren+seated+outside.jpg?auto=compress%2Cformat&rect=0%2C275%2C4000%2C1875&w=800&h=375"
--
  | Received string: "https://images.prismic.io/wellcomecollection/2a42de1c-7954-4ece-be5f-775079c4bc54_Lauren+seated+outside.jpg?auto=format%2Ccompress&rect=&w=800&h="

It seems the rect, w and h is missing, which is probably in line with the first issue. We should figure out why this is happening and fix it.

rcantin-w commented 2 months ago

See Slack conversation

It seems Prismic's Migration API strips images' crops of their contentUrlSuffix value, which is what is needed to render the correct ratio of image.

Should look like:

 '32:15': {
      contentUrlSuffix: '&rect=0,136,482,226&w=3200&h=1500',
      width: 3200,
      height: 1500
    }

Now looks like:

 '32:15': { contentUrlSuffix: '', width: 3200, height: 1500 }

This is probably something to report to Prismic.

davidpmccormick commented 2 months ago

From Prismic:

Ok thanks for sharing, helps a lot, I reached out to the team, these url params should still be there. Not sure why they got stripped.

I imagine this will ultimately require another migration, but don't think we can do anything until we hear more from Prismic.

pollecuttn commented 1 month ago

@davidpmccormick Have you heard anything back from Prismic yet? Worth chasing them if not?

davidpmccormick commented 3 weeks ago

https://prismic.atlassian.net/servicedesk/customer/portal/1/PCS-5263

Image

Unfortunately the link in that response (https://prismic.atlassian.net/browse/BT-107) doesn't resolve anywhere useful. I have asked that they point us somewhere where we can keep up-to-date with the status of the bug.

rcantin-w commented 4 days ago

@davidpmccormick did we ever get that bug link? Wondering if we want to use a FE catchup to brainstorm ideas for this, lmk if useful!

davidpmccormick commented 1 day ago

Still nothing. I have chased again.

davidpmccormick commented 1 day ago

Currently, we do not have an estimated time for when this issue will be resolved. We’re also reaching out to Atlassian support to understand why you can’t see the open bug. We apologize for any inconvenience these issues may cause.