[BUG] Broken images link after file import

Hello! I’m writing here because of a problem that we have.
Here’s the step to reproduce it:

  • download the prismic documents via the “Export your documents” functionality
  • upload one of them (containing at least one image) using the “Import your documents” functionality
  • query the document

Expected output:
The image should have the same url as before: https://organization.prismic.io/...path

Actual output:
The image has a different url: https://prismic-io.s3.amazonaws.com/...path

More specifically: We can reproduce this issue using an image field inside a slice.

Here’s the json of the downloaded doc:

Here’s the json of uploaded and downloaded again doc:


That problem is causing us missing images in production. We are trying to understand why doesn’t this new url work on our website, but we also would benefit in knowing how to restore the old urls (except manually replace every image in the cms UI)

Thank you in advance for your support

Hello @alessandro.scandone :slightly_smiling_face:,

My apologies for just responding to this.

Welcome to Prismic community, and thanks for reaching out to us.

I am trying to reproduce this issue on my end, and I will get back to you when I have news on this.

Kind regards,
Racheal.

Hello again, @alessandro.scandone

I was able to reproduce the issue on my end, and I have informed our team about it; if/when the team finds time to look into this, they’ll contact you here.

Kind regards,
Racheal.

A post was split to a new topic: Prismic Image Link

Hello Racheal, any news on this?

Is it possible that fetching the images from https://prismic-io.s3.amazonaws.com/... rather than fetching them from *.cdn.prismic.io results in worse performance? Where can we get info about the capabilities of Prismic's CDN?

Hello @francesco.mastellone :slightly_smiling_face:,

My apologies for just responding to this.

Welcome to Prismic community, and thanks for reaching out to us.

Can you tell me more about what you mean when you say worse performance and your use case?

We use imgix for image transformation, not CDN; I attached a link below to tell you more about the best practices for image upload.

Thanks,
Racheal.

Hello Racheal,

My comment is deeply related to the original topic - I work in the same company as Alessandro :slight_smile:

I'll recap the issue again.

When using Prismic's import feature, stored image URLs change from:
https://<organization>.cdn.prismic.io/<image path>
to:
https://prismic-io.s3.amazonaws.com/<image path>

I read cdn in the original image URL, which makes me think that you're using a Content Delivery Network (CDN) to serve the original image, whereas you're not using a CDN to serve the imported image. Is this correct?

To be clear, my question is not related to image transformation, it's related to how the image is served.

Hello @alessandro.scandone @francesco.mastellone, I checked that the image format is SVG, and it's an expected behavior for SVGs images not coming through imgix CDN and not a bug.

We removed SVGs from the imgix CDN due to security vulnerabilities, and they were moved to the amazon server and were treated as files, not images. They are the only image format served like this. Originally on the Amazon server, they weren't run through the CDN.

Please go through the following blog to learn how Prismic handles SVGs: Changes to how we handle SVG's - Prismic

So there are some domains:
All images, except for SVG's , should be coming from images.prismic.io
SVG's should be coming from <repo-name>. cdn.prismic.io/ <repo-name>
(if they are coming from prismic-io.s3.amazonaws.com/, then try to remove and re-add them to deliver them from<repo-name>. cdn.prismic.io/ and see if it works.)

Give this a try, and let me know.

Thanks,
Racheal.