gatsbyjs / gatsby-source-wordpress-experimental

The upcoming v4 of gatsby-source-wordpress, currently in beta
MIT License
385 stars 100 forks source link

Tiny inline images are generated with useGatsbyImage #399

Closed robations closed 3 years ago

robations commented 3 years ago

Not sure if this is a bug or a question.

With html.useGatsbyImage = true (default), all images from Wordpress are being resized to 150px wide or less. I can see from the WP Graphql API an image might be, say, 560x280px but is still displayed at 150px wide. The WP markup looks like:

<img loading="lazy" src="https://thewordpressurl/wp-content/uploads/2020/11/theimage.jpg" alt="lorem ipsum" width="560" height="280">

What I've tried:

Is this expected behaviour? Is there any other way of controlling the image size for inline images? Should I avoid useGatsbyImage until more control is added?

TylerBarnes commented 3 years ago

Hi @robations if you update to the latest versions of all the plugins the fallback image size has been increased. If it's still a problem after upgrading (or you are on latest already), are you able to share a reproduction so we can take a look? Thanks!

robations commented 3 years ago

@TylerBarnes thanks for your reply. I hadn't seen that the plugin has jumped a couple of major versions recently (3 -> 6).

I've now upgraded from 3.3.1 to 6.0.0, and applied a bunch of other minor/bugfix upgrades within the gatsby ecosystem, but I'm still seeing the 150px images.

I did already try setting html.fallbackImageMaxWidth to 800, but it doesn't have any effect on the output. Is there another fallback size you are referring to?

Unfortunately, there is nothing public I can share immediately. I might be able to put a test case online, but will require setting up copies of both WP and gatsby.

TylerBarnes commented 3 years ago

In order to debug/fix this we'll need a reproduction repo and /graphql url - if you can do that please re-open this issue or drop a comment here at that time. Thanks @robations !