-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: problem getting metadata (#227)
Uses `probe-image-size` to fetch metadata when its missing, instead of the Cloudinary `getinfo` flag. Removes the errors reported in #223, but will still not adhere to the `cloudinaryAssetData` flag.
- Loading branch information
Showing
12 changed files
with
564 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
import { graphql, useStaticQuery } from 'gatsby'; | ||
import { GatsbyImage, getImage } from 'gatsby-plugin-image'; | ||
|
||
const EmptyDataPage = () => { | ||
const data = useStaticQuery(graphql` | ||
query { | ||
allEmptyData { | ||
nodes { | ||
name | ||
expected | ||
cloudinary { | ||
gatsbyImageData(width: 200, backgroundColor: "#BADA55") | ||
} | ||
} | ||
} | ||
} | ||
`); | ||
|
||
return data.allEmptyData.nodes.map((node, index) => { | ||
const gatsbyImage = getImage(node.cloudinary); | ||
|
||
return ( | ||
<> | ||
<h2>{node.name}</h2> | ||
<div> | ||
<strong>Expected:</strong> {node.expected} | ||
</div> | ||
{gatsbyImage ? ( | ||
<GatsbyImage key={index} image={gatsbyImage} alt={node.name} /> | ||
) : ( | ||
<div>No image for node with name: {node.name}</div> | ||
)} | ||
</> | ||
); | ||
}); | ||
}; | ||
|
||
export default EmptyDataPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
import { graphql, useStaticQuery } from 'gatsby'; | ||
import { GatsbyImage, getImage } from 'gatsby-plugin-image'; | ||
|
||
const VariedDataPage = () => { | ||
const data = useStaticQuery(graphql` | ||
query { | ||
allVariedData { | ||
nodes { | ||
name | ||
expected | ||
gatsbyImageData(height: 200, backgroundColor: "#BADA55") | ||
} | ||
} | ||
} | ||
`); | ||
|
||
return data.allVariedData.nodes.map((node, index) => { | ||
const gatsbyImage = getImage(node); | ||
|
||
return ( | ||
<> | ||
<h2>{node.name}</h2> | ||
<div> | ||
<strong>Expected:</strong> {node.expected} | ||
</div> | ||
{gatsbyImage ? ( | ||
<GatsbyImage key={index} image={gatsbyImage} alt={node.name} /> | ||
) : ( | ||
<div>No image for node with name: {node.name}</div> | ||
)} | ||
</> | ||
); | ||
}); | ||
}; | ||
|
||
export default VariedDataPage; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.