Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prismic provider doesn't work when selecting a placeholder image from Unsplash #1600

Open
mrleblanc101 opened this issue Nov 16, 2024 · 0 comments

Comments

@mrleblanc101
Copy link

mrleblanc101 commented Nov 16, 2024

In Prismic, when selection on image, you have two choices.

  1. Upload your own image
  2. Select an image from Unsplash

The provider work properly when you upload yout own image:
Image

But it doesn't work properly when you select an unsplash image in the interface:
Image

The image on the top comes from <NuxtImg provider="prismic" :src="slice.primary.image.url" />, the image on the bottom comes from <PrismicImage :field="slice.primary.image">.

@nuxt/image seems to replace the images.unsplash.io from images.prismic.io regardless:

<!-- NuxtImg -->
<img
  onerror="this.setAttribute('data-error', 1)"
  data-nuxt-img=""
  srcset="
    https://images.prismic.io/photo-1597714026720-8f74c62310ba?crop=entropy&amp;cs=srgb&amp;fm=jpg&amp;ixid=M3wzMzc0NjN8MHwxfHNlYXJjaHwxfHxjaXRydXMlMjBmcnVpdHxlbnwwfHx8fDE3MzE3NDQ4NzZ8MA&amp;ixlib=rb-4.0.3&amp;q=70 1x,
    https://images.prismic.io/photo-1597714026720-8f74c62310ba?crop=entropy&amp;cs=srgb&amp;fm=jpg&amp;ixid=M3wzMzc0NjN8MHwxfHNlYXJjaHwxfHxjaXRydXMlMjBmcnVpdHxlbnwwfHx8fDE3MzE3NDQ4NzZ8MA&amp;ixlib=rb-4.0.3&amp;q=70 2x
  "
  src="https://images.prismic.io/photo-1597714026720-8f74c62310ba?crop=entropy&amp;cs=srgb&amp;fm=jpg&amp;ixid=M3wzMzc0NjN8MHwxfHNlYXJjaHwxfHxjaXRydXMlMjBmcnVpdHxlbnwwfHx8fDE3MzE3NDQ4NzZ8MA&amp;ixlib=rb-4.0.3&amp;q=70"
  data-v-inspector="node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@nuxt/image/dist/runtime/components/NuxtImg.vue:2:3"
  data-error="1"
/>
<!-- PrismicImage -->
<img
  src="https://images.unsplash.com/photo-1597714026720-8f74c62310ba?crop=entropy&amp;cs=srgb&amp;fm=jpg&amp;ixid=M3wzMzc0NjN8MHwxfHNlYXJjaHwxfHxjaXRydXMlMjBmcnVpdHxlbnwwfHx8fDE3MzE3NDQ4NzZ8MA&amp;ixlib=rb-4.0.3&amp;q=85"
  alt="orange fruits under blue sky during daytime"
  class="es-alternate-grid__image es-alternate-grid__image--left"
/>

Data:

{
  "dimensions": {
    "width": 5688,
    "height": 3792
  },
  "alt": "orange fruits under blue sky during daytime",
  "copyright": null,
  "url": "https: //images.unsplash.com/photo-1597714026720-8f74c62310ba?crop=entropy&cs=srgb&fm=jpg&ixid=M3wzMzc0NjN8MHwxfHNlYXJjaHwxfHxjaXRydXMlMjBmcnVpdHxlbnwwfHx8fDE3MzE3NDQ4NzZ8MA&ixlib=rb-4.0.3&q=85",
  "id": "eaOjEz8746k",
  "edit": {
    "x": 0,
    "y": 0,
    "zoom": 1,
    "background": "transparent"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant