Wrapper of the Sharp image manipulation library for Gatsby plugins
A utility module that processes images using different intelligent cropping and fitting strategies to optimize image presentation for various contexts.
@generates
/**
* Crops an image using attention-based focus detection
*
* @param {string} imagePath - Path to the source image file
* @param {number} width - Target width in pixels
* @param {number} height - Target height in pixels
* @returns {Promise<Object>} Object containing image buffer and metadata
*/
async function cropWithAttention(imagePath, width, height) {
// IMPLEMENTATION HERE
}
/**
* Crops an image using entropy-based region selection
*
* @param {string} imagePath - Path to the source image file
* @param {number} width - Target width in pixels
* @param {number} height - Target height in pixels
* @returns {Promise<Object>} Object containing image buffer and metadata
*/
async function cropWithEntropy(imagePath, width, height) {
// IMPLEMENTATION HERE
}
/**
* Crops an image with directional focus
*
* @param {string} imagePath - Path to the source image file
* @param {number} width - Target width in pixels
* @param {number} height - Target height in pixels
* @param {string} direction - Direction: 'center', 'north', 'south', 'east', 'west', 'northeast', 'northwest', 'southeast', 'southwest'
* @returns {Promise<Object>} Object containing image buffer and metadata
*/
async function cropDirectional(imagePath, width, height, direction) {
// IMPLEMENTATION HERE
}
/**
* Resizes an image using a specific fit strategy
*
* @param {string} imagePath - Path to the source image file
* @param {number} width - Target width in pixels
* @param {number} height - Target height in pixels
* @param {string} strategy - Fit strategy: 'cover' or 'contain'
* @returns {Promise<Object>} Object containing image buffer and metadata
*/
async function resizeWithFit(imagePath, width, height, strategy) {
// IMPLEMENTATION HERE
}
module.exports = {
cropWithAttention,
cropWithEntropy,
cropDirectional,
resizeWithFit
};Provides image processing and intelligent cropping capabilities
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