question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Skip / Speedup Image Generation Processes

See original GitHub issue

Summary

i would like to skip the step of creating image thumbnails and create “fake” thumbnails.

Basic example

  • i set some option to skip the thumbnail creation / image processing

  • it creates “Fake” imagesets, and i can query all sharp image options from GraphQL, but it always return the original image without changes

  • i don’t remember if there was planned an api for different image manipulation providers (image sharp, external services, lambda functions, gatsby cloud) - but then it can set up with a fake image service…

Motivation

  • i running the gatsby develop command in the gatsby doc site.
  • in some times something needs to run gatsby clean and the thumbnails are not cached anymore and it needs recreated
  • in most times i do not care of the image quality while developing

Times:

1943.298 s 2678/4226 63% Generating image thumbnails

success run page queries - 1329.928s - 4622/4622 3.48/s
success Generating image thumbnails - 2196.493s - 4226/4226 1.92/s

about 36min 😦

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:29 (18 by maintainers)

github_iconTop GitHub Comments

9reactions
josephmarkuscommented, Jul 19, 2020

Looks like I created a duplicate here - https://github.com/gatsbyjs/gatsby/issues/25827

There’s a bunch of options I considered for a project I work on.

I think there’s two ideas that are worth pointing out:

  1. Add a plugin option to gatsby-plugin-sharp to return original image src without doing the time consuming resizing when in development. This way my earlier mentioned GraphQL would still work, but every value would be the same unresized image src. It’s a sort of by-pass without breaking the application.

It could look something like this:

plugins: [
  {
    resolve: `gatsby-plugin-sharp`,
    options: {
      skipProcessing: process.env.NODE_ENV !== 'production'
    },
  },
]
  1. As suggested by @polarathene - have separate cache for images, so it doesn’t get flushed with every update in package.json/yarn.lock and/or gatsby-config
9reactions
afladmarkcommented, Jun 17, 2020

This a major problem for one project I’m working on. Every time I add or update an unrelated NPM package Gatsby blows away the image cache and I can’t work for 2 hours (yes, literally, and on an 8 core i9 CPU) while it regenerates 80k image thumbnails. It’s brutal. Our Gatsby Cloud builds can do it in about ~45 minutes by comparison.

For this use case, I can think of two approaches to mitigate this:

  1. Make the cache more resilient/reusable. Can we narrow down what changes necessitate blowing away the image cache?

  2. In ‘develop’ mode, could these be generated lazily at the point of need/access? Generating 80k images upfront that I almost certainly don’t even need makes working with Gatsby locally incredibly painful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

David Cramer on Twitter: "@sirwart @cameronmcefee IMO if I did it ...
Feature Request : Skip / Speedup Image Generation Processes · Issue #24822 ... Summary i would like to skip the step of creating...
Read more >
A survey on Image Data Augmentation for Deep Learning
This survey will present existing methods for Data Augmentation, promising developments, and meta-level decisions for implementing Data ...
Read more >
Speed up Docker image build process of a Rails app - BigBinary
A feature request for providing a shared host machine directory path option to the docker build command is still open here. To reuse...
Read more >
8 Tips for Faster Puppeteer Screenshots - Bannerbear
When optimizing Puppeteer, remember that there are only so many ways to speed up the startup/shutdown performance of Puppeteer itself.
Read more >
9 Quick Ways to Improve Page Loading Speed - HubSpot Blog
Speed Up Your Website with HubSpot's Built-In CDN ... a page redirects somewhere else, it prolongs the HTTP request and response process.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found