MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / Crop

Method Crop

internal/attachments/processor.go:55–55  ·  view source on GitHub ↗

Crop returns the rectangular sub-image bounded by `rect`. The rectangle is interpreted in the image's coordinate space (origin top-left) and intersected with the image bounds — a rect that extends past the bounds is silently clipped rather than rejected, so the editor's crop tool (TASK-880) can be l

(img image.Image, rect image.Rectangle)

Source from the content-addressed store, hash-verified

53 // extends past the bounds is silently clipped rather than rejected,
54 // so the editor's crop tool (TASK-880) can be lazy with rounding.
55 Crop(img image.Image, rect image.Rectangle) (image.Image, error)
56
57 // Encode writes img to w in the given format ("png" / "jpeg").
58 // JPEG is encoded at quality 85 — small enough for thumbnails,

Callers 5

TestProcessor_CropFunction · 0.95
CropMethod · 0.65
applyImageTransformFunction · 0.65

Implementers 1

pureGoProcessorinternal/attachments/processor_purego.

Calls

no outgoing calls