Giter VIP home page Giter VIP logo

Comments (3)

harlan-zw avatar harlan-zw commented on August 17, 2024 1

Please just use an img tag, I think NuxtImg has issues .

You don't need the responsiveness or the resizing

from og-image.

JulienHenrotin avatar JulienHenrotin commented on August 17, 2024

Okay I find something !
I changed my OG image template and I define width height and sizes in nuxtImg

<template>
  <div class="h-screen w-full flex flex-col items-center bg-cover bg-top bg-no-repeat" :style="{ backgroundImage: 'url(https://henoo.fr/pictures/illustrations/landing/cloud.png)' }">
    <div class="flex flex-col items-center flex-grow justify-center">
      <!-- edited this balise 👇 -->
      <NuxtImg
        v-if="picture"
        class="size-40 rounded-full mb-6"
        alt="user profile picture"
        :src="picture"
        width="150"
        height="150"
        sizes="xs:200px sm:210px md:220px lg:230px xl:240px xxl:250px '2xl':260px"
      />
      <div class="text-3xl text-center !font-semibold my-6">
        {{ userName }} t'invite à sortir
      </div>
    </div>
    <div class="mb-6">
      <NuxtImg src="https://henoo.fr/logo/logo_text.png" class="h-12" />
    </div>
  </div>
</template>

Know I don't have the 500 error. But unfortunately the image whose tag I've modified doesn't appear in the final image.
I looked at my server logs and I have :
Can't load image http://web-dev.henoo.fr/_ipx/s_500x500/https://filesdev.henoo.fr/user/16616_1721310762248?1722417805412: fetch failed

If I load the full link in my browser I get the image. That's all that's left. The server-side module can't get the image.

from og-image.

JulienHenrotin avatar JulienHenrotin commented on August 17, 2024

Yeah it's what I tried it's working fine now 👍

It's weird because the second works properly.

In any case, thank you very much for this package 🩵

**Final code**

<template>
  <div class="h-screen w-full flex flex-col items-center bg-cover bg-top bg-no-repeat" :style="{ backgroundImage: 'url(https://henoo.fr/pictures/illustrations/landing/cloud.png)' }">
    <div class="flex flex-col items-center flex-grow justify-center">
      <img
        v-if="picture"
        class="size-40 rounded-full mb-6"
        alt="user profile picture"
        :src="picture"
        width="150"
        height="150"
      >
      <div class="text-3xl text-center !font-semibold my-6" v-text="`${userName} t'invite à sortir`" />
    </div>
    <div class="mb-6">
      <NuxtImg src="https://henoo.fr/logo/logo_text.png" class="h-12" />
    </div>
  </div>
</template>

<script setup lang="ts">
withDefaults(defineProps<{ userName?: string, picture?: string }>(), { userName: 'Ton pote', picture: undefined })
</script>

from og-image.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.