CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-gatsby-plugin-sharp

Wrapper of the Sharp image manipulation library for Gatsby plugins

58%

Overall

Evaluation58%

1.07x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-5/

Image Metadata Service

A utility service that extracts metadata from images for layout calculations and optimization decisions.

Capabilities

Extract Image Dimensions

  • Given an image file at path "./test/fixtures/sample.jpg", extracts and returns width (800) and height (600) @test
  • Given a PNG image at path "./test/fixtures/logo.png", correctly extracts width (200) and height (200) @test

Extract Image Format

  • Given an image file, identifies and returns the format as a string (e.g., "jpeg", "png", "webp") @test

Extract Dominant Color

  • Given an image file, extracts the dominant color and returns it in hexadecimal format (e.g., "#ff5733") @test

Implementation

@generates

API

/**
 * 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,
};

Dependencies { .dependencies }

gatsby-plugin-sharp { .dependency }

Provides image processing and metadata extraction capabilities.

@satisfied-by

tessl i tessl/npm-gatsby-plugin-sharp@5.15.0

tile.json