images

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package images is the image processor of pi-durable: it prepares the images read returns so the model can take them.

Ports packages/durable/src/images/index.ts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePhotonImages

func CreatePhotonImages() tools.ImageProcessor

CreatePhotonImages is the tools.ImageProcessor for tools.CreateCodingTools and tools.CreateReadTool.

An image already upright, in a format providers take inline, and within the limits is returned as it is, once it decodes. Otherwise it is turned upright by its EXIF orientation, scaled to the maximum width and height, and encoded as PNG or JPEG at falling qualities (JPEG first for JPEG sources), then at smaller dimensions, 3/4 at a time, until the base64 fits. Formats providers do not take inline (BMP) become PNG.

Decoding takes the image's RGBA size in memory. The work runs on the calling goroutine, one call at a time in call order as on Pi's one thread, and stops at the next step when its context is cancelled.

func ExifOrientation

func ExifOrientation(data []byte) int

ExifOrientation is the EXIF orientation of a JPEG or WebP, 1 to 8; 1 when absent or unreadable.

Types

This section is empty.

Directories

Path Synopsis
Package cloudflare is the image processor for Cloudflare Workers and Durable Objects.
Package cloudflare is the image processor for Cloudflare Workers and Durable Objects.
Package node is the image processor for hosts that load Photon's WebAssembly from an installed package.
Package node is the image processor for hosts that load Photon's WebAssembly from an installed package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL