I have a blog with close to 200 hundred posts where one of the GraphQL queries fetches the author for each post (name, info, avatar). The problem is that I only have 2 authors in there but, when building the site, Gatsby is re-creating that avatar over and over...for each post. I can see it in Netlify's console log:
8:13:53 PM: warning
8:13:53 PM: The requested width "120px" for a resolutions field for
8:13:53 PM: the file /opt/build/repo/static/images/uploads/authors/rick.png
8:13:53 PM: was larger than the actual image width of 96px!
8:13:53 PM: If possible, replace the current image with a larger one.
8:13:53 PM: warning
8:13:53 PM: The requested width "120px" for a resolutions field for
8:13:53 PM: the file /opt/build/repo/static/images/uploads/authors/rick.png
8:13:53 PM: was larger than the actual image width of 96px!
8:13:53 PM: If possible, replace the current image with a larger one.
8:13:53 PM: warning
8:13:53 PM: The requested width "120px" for a resolutions field for
8:13:53 PM: the file /opt/build/repo/static/images/uploads/authors/morty.png
8:13:53 PM: was larger than the actual image width of 96px!
8:13:53 PM: If possible, replace the current image with a larger one.
8:13:53 PM: warning
8:13:53 PM: The requested width "120px" for a resolutions field for
8:13:53 PM: the file /opt/build/repo/static/images/uploads/authors/rick.png
8:13:53 PM: was larger than the actual image width of 96px!
8:13:53 PM: If possible, replace the current image with a larger one.
Apparently the avatar is smaller than the desired state but it's a good thing because this way I'm able to see where the holdup is.
I'm using fragments to query for the data but I see no reason why it would matter:
Any idea about how to make Gatsby understand that this avatar was just created milliseconds ago and re-use that one instead? It has the exact same parameters as hundreds before it and I see no reason why it has to create it over and over again.
I'm more concerned about the build command because 99% of the time I get a timeout in Netlify due to this.
@freiksenet Any idea why that could be happening?
@wardpeet is looking at this, possibly could be an issue with sharp's job queue.
Hiya!
This issue has gone quiet. Spooky quiet. 馃懟
We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contributefor more information about opening PRs, triaging issues, and contributing!
Thanks for being a part of the Gatsby community! 馃挭馃挏
@ciokan sorry for my late response. If the same image is used we don't process it multiple times. We only do the heavy lifting once but sadly we show up the warning for each image.
Or are you facing an issue where we do generate the icon 100 of times?
I'm just trying to track down what exactly is slowing the deployment. I'm not seeing hundreds of avatars being generated. I thought it generates the same avatar hundreds of times though. If there's just a warning being sent to the console it's fine with me. I didn't know that - hence the ticket.
Hi @ciokan
I'm experiencing this issue and I was wondering if you found out what was causing this issue for you?