Replies: 103 comments 361 replies
-
Is the API complete or will there still be props for adding CSS classes and styles to the actual image and placeholder image like there is in the old If they won't be added, then there is no way to override the default Adding |
Beta Was this translation helpful? Give feedback.
-
Im currently using aspect ratio like this:
Is this still possible with the new image plugin? |
Beta Was this translation helpful? Give feedback.
-
Just want to report an issue Im having with theme-ui. When I activate dark mode the image seems to Edit: Here are more details about my problem. Im using theme-ui and the The code looks like this:
When I navigate to a different page on the website and I click to activate dark mode, the image changes to blurred state and remains blurred while I toggle dark mode. If I remove the |
Beta Was this translation helpful? Give feedback.
-
Probably a bit late to this, but one of the frustrations with the original GatsbyImage was the lack of lazy-loading support for SVGs. It would be great if that option could be available. I understand that Gatsby will inline smaller SVGs, but for larger SVGs, lazy loading to reduce requests is very helpful. A unified API would also improve workflow through CMSs where a developer has little (or less) control over image file types that might be chosen. |
Beta Was this translation helpful? Give feedback.
-
I'm seeing a console warning when i try this plugin. I'm not doing anything outside the very basic example provided for using it. Is anyone else seeing this?
|
Beta Was this translation helpful? Give feedback.
-
Heres example output of one of the rendered images creating the error. It seems the problem could be in /gatsby-plugin-image/gatsby-ssr.js but not 100% sure.
I'm pulling image through graphql like so: |
Beta Was this translation helpful? Give feedback.
-
Is this ready for use with Contentful? I can't find the new |
Beta Was this translation helpful? Give feedback.
-
Hey, just been testing this out but on Gatsby Cloud, I get the error |
Beta Was this translation helpful? Give feedback.
-
That's great news, looking forward to the release. Is there any change around the fact that whenever the |
Beta Was this translation helpful? Give feedback.
-
Hi gatsby community. |
Beta Was this translation helpful? Give feedback.
-
Hey, just migrated and tested these on my site that is quite image heavy. It wasn't a very scientific test since for portfolio page I changed to use webp (since it is enabled by default in the beta) and I changed from blurred to traced SVG for the print page. I love that you are trying to improve these issues :) |
Beta Was this translation helpful? Give feedback.
-
Great work Ward. That was a needed change. One thing I may ask is to support background images. I know and use the wonderful plugin, gatsby-background-image by @timhagn but feel like it should be a built-in feature. |
Beta Was this translation helpful? Give feedback.
-
This is fantastic! Will support for passing custom attributes to the component (e.g. It was mentioned in #24876 as a possibility. |
Beta Was this translation helpful? Give feedback.
-
I'm running into an issue with
My plugin is using this version. It works when I run gatsby build locally. I've also tried clearing cache on gatsby cloud but same issue |
Beta Was this translation helpful? Give feedback.
-
Hey, I'm trying out the migration method using I'm fetching images from
Currently on production with
Using
|
Beta Was this translation helpful? Give feedback.
-
Hi @ascorbic, thanks for your work on this plugin. I currently use a way of creating different image sizes/ratios on the old image component like so:
Am I able to use the same logic in the new component? So far I can't seem to override the sizes or aspect ratio without having to set it in GraphQL. If this is possible that would be great otherwise refactoring will be a bit of a pain passing down new data points! |
Beta Was this translation helpful? Give feedback.
-
I tested the plugin on our client's website (with Contentful integration) and here are 2 issues:
Here is the gatsby-image website: https://drsmile.de/ |
Beta Was this translation helpful? Give feedback.
-
Hi @ascorbic, I'm tryng the new useArtDirection hook, I'm just wondering why it has to be an hook? In the source code it does not use any native hook, and as it is it's impossible to use it in a loop, like when I have a full-page slider of images. I think it should be exported as an utility function like getImage. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
How do I use gatsby-plugin-image together with gatsby-plugin-mdx? I have not seen anything in the docs about how to use gatsby-plugin-image with MDX. |
Beta Was this translation helpful? Give feedback.
-
OverviewHey! I've been using the plugin for quite some time now. In one of my components, I use a <StaticImage src="../../../../../images/my-image.png" alt="my image" /> Is there a way I can avoid using relative URLs for the ConfigurationHere are some relevant configuration details: // gatsby-config.js
// ...
[
// ...
{
resolve: "gatsby-source-filesystem",
options: {
name: "images",
path: `${__dirname}/src/images/`,
},
},
{
resolve: "gatsby-plugin-sharp",
options: {
useMozJpeg: false,
defaultQuality: 100,
},
},
"gatsby-transformer-sharp",
"gatsby-plugin-image",
// ...
]
// ... // gatsby-node.js
// Extend `webpack` configuration
exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
resolve: {
// Import aliases
alias: {
"~": `${__dirname}/src`,
},
},
})
} ConclusionAlthough this is not an annoying bug, I still find it a little inconvenient to use relative URLs. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hey! I was looking to configure some of the default values for some options ( I'd prefer if options could be passed via Any help would be appreciated, thanks! |
Beta Was this translation helpful? Give feedback.
-
I ran into an issue with extra space under each image. I have to set |
Beta Was this translation helpful? Give feedback.
-
I am facing following problem with the gatsby plugin image. https://stackoverflow.com/questions/65423131/why-is-gatsby-plugin-image-missing-image-prop . Same imavge prop missing happened when tried contentful cms. I can't seem to find images coming from netlify cms. Also I used stacticImage and some images are showing properly and then some images are not showing at all even the src path to image is correct @talohana |
Beta Was this translation helpful? Give feedback.
-
Hi,
What does that do exactly? And how does it help with the problem i encountered?
…________________________________
Lähettäjä: Tal Ohana <[email protected]>
Lähetetty: perjantai 26. helmikuuta 2021 15.30
Vastaanottaja: gatsbyjs/gatsby <[email protected]>
Kopio: Jukka Koivu <[email protected]>; Comment <[email protected]>
Aihe: Re: [gatsbyjs/gatsby] gatsby-plugin-image beta (#27950)
Sorry for the delay, I can share any additional types if necessary (or the entire generated.ts file)
export type File = Node & {
readonly __typename?: 'File';
readonly sourceInstanceName: Scalars['String'];
readonly absolutePath: Scalars['String'];
readonly relativePath: Scalars['String'];
readonly extension: Scalars['String'];
readonly size: Scalars['Int'];
readonly prettySize: Scalars['String'];
readonly modifiedTime: Scalars['Date'];
readonly accessTime: Scalars['Date'];
readonly changeTime: Scalars['Date'];
readonly birthTime: Scalars['Date'];
readonly root: Scalars['String'];
readonly dir: Scalars['String'];
readonly base: Scalars['String'];
readonly ext: Scalars['String'];
readonly name: Scalars['String'];
readonly relativeDirectory: Scalars['String'];
readonly dev: Scalars['Int'];
readonly mode: Scalars['Int'];
readonly nlink: Scalars['Int'];
readonly uid: Scalars['Int'];
readonly gid: Scalars['Int'];
readonly rdev: Scalars['Int'];
readonly ino: Scalars['Float'];
readonly atimeMs: Scalars['Float'];
readonly mtimeMs: Scalars['Float'];
readonly ctimeMs: Scalars['Float'];
readonly atime: Scalars['Date'];
readonly mtime: Scalars['Date'];
readonly ctime: Scalars['Date'];
/** @deprecated Use `birthTime` instead */
readonly birthtime?: Maybe<Scalars['Date']>;
/** @deprecated Use `birthTime` instead */
readonly birthtimeMs?: Maybe<Scalars['Float']>;
readonly blksize?: Maybe<Scalars['Int']>;
readonly blocks?: Maybe<Scalars['Int']>;
/** Copy file to static directory and return public url to it */
readonly publicURL?: Maybe<Scalars['String']>;
readonly childImageSharp?: Maybe<ImageSharp>;
readonly id: Scalars['ID'];
readonly parent?: Maybe<Node>;
readonly children: ReadonlyArray<Node>;
readonly internal: Internal;
readonly childMdx?: Maybe<Mdx>;
};
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#27950 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKJBP6JJNSW4WPIVRWXC4B3TA6O65ANCNFSM4TQ43CZQ>.
|
Beta Was this translation helpful? Give feedback.
-
I was told to move this over here. Basically just a dead link in the npm description: |
Beta Was this translation helpful? Give feedback.
-
DescriptionAs mentioned in these pull requests (#29147, #29564), defaults for
gatsby-config.js // ...
[
// ...
{
resolve: "gatsby-plugin-sharp",
options: {
defaults: {
formats: ["avif", "webp"],
quality: 80,
placeholder: "none",
},
},
},
"gatsby-transformer-sharp",
"gatsby-plugin-image",
// ...
]
// ... The defaults for ReproductionFollow the steps below or refer to this reproduction on CodeSandbox:
BehaviorsExpectedThe ActualOn inspecting the generated HTML with Dev Tools, the When explicitly setting the Environment
gatsby info on CodeSandbox
|
Beta Was this translation helpful? Give feedback.
-
[email protected]
is now releasedThank you everyone who contributed to the discussion and tried out the plugin during the beta period.
[email protected]
has now been released, alongside Gatsby 3. We're therefore going to retire this discussion. If you have bugs to report, please ensure you have upgraded to 1.0.0 or higher, and report any outstanding issues at the issue tracker. If you have comments, feature requests or other discussions about images with Gatsby, please start another discussion.Here are the reference guides:
Beta Was this translation helpful? Give feedback.
All reactions