rfcs
                                
                                
                                
                                    rfcs copied to clipboard
                            
                            
                            
                        Exclude source/original image in sharp GraphQL image queries
Add a feature flag to not include the source image in srcset when using gatsy-plugin-sharp and gatsby-transformer-sharp.
Overall I think this seems reasonable. Someone from @gatsbyjs/core will need to sign off, though.
Why would you not want to include the original image?
If you have an image with 15 megapixels or bigger and want to keep your deployment as lean as possible, just for performance while deploying – if you're using your image with a width of 800px there is no need to "give away" an image with a width of 5000px to everybody on the web. Or perhaps you got the picture from a photographer and you're only allowed to use it up to a specific size in web. So it could be both performance or licensing reasons.
Maybe different approach to filter out very large images would be to specify cutoff threshold to not include images bigger than (for example) 2000px? We potentially could even set some defaults for this.
This would let users not worry about context and know if used images are actually big or not (especially if site would pull data from CMS and developer is not in charge of content)?
Sorry for the late reply. I really think the threshold approach would be the perfect solution. Though I think the default should be without threshold. So we wouldn't have any change for existing users but extend it to have more control.
So I would propose either to have an option like threshold which applies both for max width and max height or a threshold for each width and height. For the sake of keeping it stupid and simple I'd prefer the threshold for both width and height.
I'd agree that keeping behavior the same would be ideal for now. Maybe in the next major release we could set some guardrails up, though — seems like it would be good to save people from accidentally deploying 10MB images. 😅