Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add Image Optimization Support

Open
#59 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api, backend

Research direction

Start with the WIT bindings in stubs/wit_world/imports/image_optimizer.py and inspect the unsupported implementations in src/component/image_optimizer.rs and src/wiggle_abi/image_optimizer.rs. Compare the requested wrapper shape with the Rust and JavaScript APIs, then add coverage for parameter validation, type conversions, and Unsupported errors; done means the documented API exists and its tests pass without requiring Viceroy support.

Written by the indexing model from the issue text.

Description

Overview

Add support for Fastly's Image Optimizer API, enabling on-the-fly image transformation and optimization.

WIT Interface

interface image-optimizer {
  use http-body.{body};
  use http-req.{request};
  use http-resp.{response-with-body};
  use types.{error};
  use backend.{backend};

  resource extra-image-optimizer-transform-options;

  record image-optimizer-transform-options {
    sdk-claims-opts: option<string>,
    extra: option<borrow<extra-image-optimizer-transform-options>>,
  }

  transform-image-optimizer-request: func(origin-image-request: borrow<request>, origin-image-request-body: option<body>, origin-image-request-backend: borrow<backend>, io-transform-options: image-optimizer-transform-options) -> result<response-with-body, error>;
}

WIT bindings: stubs/wit_world/imports/image_optimizer.py

API Design

  • Simple function-based API: transform_image(request, body, backend, options)
  • ImageOptimizerOptions dataclass for transformation parameters
  • Returns tuple of (Response, Body) with optimized image
  • Body should be io.IOBase-compatible for streaming large images
  • Supports query parameter-based transformations (width, height, format, quality, etc.)
  • Integration with Backend and Request/Response APIs

Cross-SDK Comparison: Rust has transform_image_optimizer_request(), JS has similar. Go support may vary. This is a specialized/premium feature - Python wrapper should match Rust's approach with transform function accepting request, backend, and options.

Viceroy Testing

Image Optimizer is NOT supported in Viceroy. The implementation returns Error::Unsupported for all calls (src/component/image_optimizer.rs:14, src/wiggle_abi/image_optimizer.rs:18).

Tests should:

  • Verify the API wrapper exists and accepts correct parameters
  • Skip or mark as expected to fail any tests that actually call transform_image_optimizer_request()
  • Focus on testing parameter validation, type conversions, and error handling for Unsupported errors

This API is primarily testable in production or staging environments.

Reference

Dominant language
Python
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fastly/compute-sdk-python

All issues in fastly/compute-sdk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.