CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-sharp

High performance Node.js image processing library for resizing JPEG, PNG, WebP, GIF, AVIF and TIFF images

80

1.01x
Overview
Eval results
Files

rubric.jsonevals/scenario-8/

{
  "context": "This criteria evaluates how well the engineer uses the Sharp image processing library to implement border/padding functionality. The focus is on proper usage of Sharp's extend() method with its various options for creating different border styles.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Uses sharp() constructor",
      "description": "Correctly instantiates Sharp by calling sharp() with the input image (file path or Buffer) to create a Sharp instance for image processing",
      "max_score": 10
    },
    {
      "name": "Uses extend() method",
      "description": "Correctly calls the .extend() method on the Sharp instance to add borders/padding to images. This is the core method for this capability.",
      "max_score": 25
    },
    {
      "name": "Solid color borders",
      "description": "Implements solid color borders by passing border sizes (top, right, bottom, left) and background color to extend(). Uses the background option with a valid color value (hex string or object with r, g, b properties).",
      "max_score": 20
    },
    {
      "name": "Edge extension borders",
      "description": "Implements edge-extended borders by using extend() with extendWith option set to 'copy' or Sharp.strategy.copy to replicate edge pixels",
      "max_score": 15
    },
    {
      "name": "Mirrored borders",
      "description": "Implements mirrored borders by using extend() with extendWith option set to 'mirror' or Sharp.strategy.mirror to reflect image content at edges",
      "max_score": 15
    },
    {
      "name": "Buffer output",
      "description": "Correctly uses .toBuffer() method to output the processed image as a Buffer that can be returned from the async function",
      "max_score": 10
    },
    {
      "name": "Handles border sizing",
      "description": "Correctly handles border sizing options by properly converting size, top, right, bottom, left options into the format expected by extend() (single number or object with top/right/bottom/left properties)",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-sharp

tile.json