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

fix(gatsby-plugin-image): Handle breakpoints and auto-format in plugin utils #29187

Merged
merged 1 commit into from
Jan 25, 2021

Conversation

ascorbic
Copy link
Contributor

These fixes are mainly for image providers that generate images on the fly. It correctly handles auto fileformats, for image hosts that use content negotiation instead (like Cloudinary), where prviously it was failing to generate the img tag. It also adds a large number of breakpoints by default, as they're effectively free.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 25, 2021
@ascorbic ascorbic added topic: media Related to gatsby-plugin-image, or general image/media processing topics and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 25, 2021
@ascorbic ascorbic added this to To cherry-pick in V2 Release hotfixes via automation Jan 25, 2021
Copy link
Contributor

@laurieontech laurieontech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to understand the goal of EVERY_BREAKPOINTS.

@@ -4,7 +4,21 @@ import { IGatsbyImageData } from "."
import type sharp from "gatsby-plugin-sharp/safe-sharp"

const DEFAULT_PIXEL_DENSITIES = [0.25, 0.5, 1, 2]
const DEFAULT_BREAKPOINTS = [750, 1080, 1366, 1920]
export const DEFAULT_BREAKPOINTS = [750, 1080, 1366, 1920]
export const EVERY_BREAKPOINT = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is our default for hooks really going to be all of these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for plugins that don't do any actual resizing, so passing more breakpoints just makes it more likely that there will be one that is the size of the screen

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that makes sense.

@ascorbic ascorbic merged commit 25912f0 into master Jan 25, 2021
@ascorbic ascorbic deleted the fix/image-plugin-utils-fix branch January 25, 2021 13:45
vladar pushed a commit that referenced this pull request Jan 25, 2021
@vladar vladar moved this from To cherry-pick to Backport PR opened in V2 Release hotfixes Jan 25, 2021
vladar pushed a commit that referenced this pull request Jan 26, 2021
…n utils (#29187) (#29197)

(cherry picked from commit 25912f0)

Co-authored-by: Matt Kane <matt@gatsbyjs.com>
@vladar
Copy link
Contributor

vladar commented Jan 26, 2021

Published in gatsby-plugin-image@0.6.2

@vladar vladar moved this from Backport PR opened to Backported in V2 Release hotfixes Jan 26, 2021
@vladar vladar moved this from Backported to Archived in V2 Release hotfixes Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: media Related to gatsby-plugin-image, or general image/media processing topics
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants