Wrapper of the Sharp image manipulation library for Gatsby plugins
A utility service that extracts metadata from images for layout calculations and optimization decisions.
@generates
/**
* Extracts image dimensions from a file.
*
* @param {string} imagePath - The path to the image file.
* @returns {Promise<Object>} An object containing width and height in pixels.
*/
async function getImageDimensions(imagePath) {
// Implementation here
}
/**
* Extracts the format of an image file.
*
* @param {string} imagePath - The path to the image file.
* @returns {Promise<string>} The image format (e.g., "jpeg", "png", "webp").
*/
async function getImageFormat(imagePath) {
// Implementation here
}
/**
* Extracts the dominant color from an image.
*
* @param {string} imagePath - The path to the image file.
* @returns {Promise<string>} The dominant color in hexadecimal format.
*/
async function getDominantColor(imagePath) {
// Implementation here
}
module.exports = {
getImageDimensions,
getImageFormat,
getDominantColor,
};Provides image processing and metadata extraction capabilities.
@satisfied-by
tessl i tessl/npm-gatsby-plugin-sharp@5.15.0docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10