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-2/

Image Format Converter

Build a Node.js image processing tool that converts images between different formats with quality optimization.

Capabilities

Convert images to modern formats

  • Convert a JPEG image to WebP format @test
  • Convert a PNG image to AVIF format @test
  • Convert a WebP image to JPEG format @test

Handle quality settings

  • Convert an image with custom quality setting (quality: 75) @test
  • Convert an image with default quality when not specified @test

Process with format-specific options

  • Convert to JPEG with progressive encoding enabled @test
  • Convert to PNG with specific compression level @test

Implementation

@generates

API

/**
 * Converts an image file to a specified output format.
 *
 * @param {string} inputPath - Path to the input image file
 * @param {string} outputPath - Path where the converted image will be saved
 * @param {Object} options - Conversion options
 * @param {string} options.format - Target format: 'jpeg', 'png', 'webp', or 'avif'
 * @param {number} [options.quality=50] - Quality setting (1-100)
 * @param {Object} [options.jpegOptions] - JPEG-specific options
 * @param {boolean} [options.jpegOptions.progressive=true] - Enable progressive encoding
 * @param {Object} [options.pngOptions] - PNG-specific options
 * @param {number} [options.pngOptions.compressionLevel=9] - Compression level (0-9)
 * @returns {Promise<Object>} Object containing output file metadata
 */
async function convertImage(inputPath, outputPath, options) {
  // IMPLEMENTATION HERE
}

module.exports = {
  convertImage
};

Dependencies { .dependencies }

gatsby-plugin-sharp { .dependency }

Provides image processing and format conversion capabilities.

@satisfied-by

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

tile.json