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

Low quality image in Whats-App link preview #356

Open
FelixRe0 opened this issue Sep 28, 2020 · 7 comments
Open

Low quality image in Whats-App link preview #356

FelixRe0 opened this issue Sep 28, 2020 · 7 comments

Comments

@FelixRe0
Copy link

The Whats-App preview image is very low res.

Steps to reproduce:

Current:
copy https://pwa.nuxtjs.org/ into Whats-App
image

Expected:
copy i.e. https://stackoverflow.com/ into Whats-App
image

I could not figure out what the issue is. Recommendations (https://stackoverflow.com/questions/19778620/provide-an-image-for-whatsapp-link-sharing) seem to be followed.

@shadow81627
Copy link

It could be the og:image meta not having image sizes? I set width and height in nuxt.config.js

pwa: {
    meta: {
      ogImage: {
        path: '/cover.jpg',
        width: 1200,
        height: 600,
        type: 'image/jpg',
      },
    },
  },

@atinux
Copy link
Member

atinux commented Oct 16, 2020

Does @shadow81627 fixes your issue @FelixRe0 ?

@FelixRe0
Copy link
Author

It could be the og:image meta not having image sizes? I set width and height in nuxt.config.js

pwa: {
    meta: {
      ogImage: {
        path: '/cover.jpg',
        width: 1200,
        height: 600,
        type: 'image/jpg',
      },
    },
  },

True https://pwa.nuxtjs.org/ is missing these.
However for our site the props are set and we have the same issue.

width: 1200,
height: 630,
type: 'image/png',

@shadow81627
Copy link

shadow81627 commented Oct 16, 2020

The stack overflow thread @FelixRe0 linked has a reply suggesting to supply multiple og:images of different sizes. https://stackoverflow.com/a/61078968

<meta property="og:image" content="https://www.link.com/facebook.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />


<meta property="og:image" content="https://www.link.com/whatsapp.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="400" />

Which looks like is supported by the open graph spec. https://ogp.me/#array

The facebook share docs recommend supply a 1:1 ratio image for some share types: https://developers.facebook.com/docs/sharing/best-practices#images

Does the Nuxt PWA module support multiple og images?

@atinux I also noticed in the facebook share debugger that the nuxt PWA module docs preview image has a duplicate / in the url eg. https://pwa.nuxtjs.org//preview.png
https://developers.facebook.com/tools/debug/?q=https%3A%2F%2Fpwa.nuxtjs.org%2F

@atinux
Copy link
Member

atinux commented Oct 16, 2020

From what I see, it only support one og:image: https://github.com/nuxt-community/pwa-module/blob/dev/lib/meta/module.js#L179-L221

I think this would be an improvement to support an array value, maybe @pi0 has some ideas about it?

About the preview, nice catch, it will be fixed right inside the docs theme: nuxt/content#574

@pi0
Copy link
Member

pi0 commented Oct 16, 2020

PR welcome to support ogImage as an array (for this we need unique hid on each since latest logic is runtime merge)

BTW goal of this module is to add as much as possible without configuration. Additional og:image meta can be provided by configuration directly in nuxt.config

FelixRe0 added a commit to FelixRe0/pwa-module that referenced this issue Oct 19, 2020
@FelixRe0
Copy link
Author

#380 (comment) => I'm not sure why additional ogImages are not merged into the head even through they have an unique hid. Suggestions welcome.

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

4 participants