Skip to main content

Module transform

Module transform 

Source
Expand description

Rotating, flipping and cropping an item’s original file, following Eagle’s viewer.

Eagle rewrites the original in place and keeps its name. A JPEG is turned losslessly by changing its EXIF orientation; PNG, WebP and BMP are drawn rotated and encoded again. Cropping re-encodes PNG, JPEG and WebP. After either, the item is refreshed like “Refresh Thumbnail”: size and file times are read again, width and height measured, the thumbnail redrawn and the palette recomputed.

Undo can’t bring back overwritten pixels, so these edits mark the open undo transaction irreversible (as a permanent delete does). Eagle has no undo for them either.

Structs§

PixelRect
A rectangle in the original image’s displayed pixels (EXIF orientation applied), as Eagle’s crop tool measures it.

Enums§

Flip
A mirror direction for Library::flip_item.

Functions§

can_crop
Formats Eagle’s crop tool works on.
can_flip
Formats Eagle’s flip button writes to disk (AVIF is accepted by Eagle but fails when written, and falcon can’t encode it).
can_rotate
Formats Eagle’s rotate button works on.
flip_orientation
The orientation after mirroring an image shown with orientation o. A horizontal mirror of a turned image is the mirrored image turned the other way; a vertical mirror is a horizontal one plus a half turn.
is_animated
An animated PNG (an acTL chunk) or WebP (an ANIM chunk).
jpeg_orientation
A JPEG’s EXIF orientation: 1 when it has none, None if it isn’t a JPEG.
set_jpeg_orientation
Returns data with its EXIF orientation set to o; the image data is copied unchanged. An existing tag is overwritten in place. If the EXIF block has no orientation, a copy of IFD0 with the tag added is appended to the block and the header pointed at it (offsets elsewhere stay valid). A JPEG with no EXIF gets a minimal block after its JFIF header.
turn_orientation
The orientation after turning an image shown with orientation o by turns more clockwise quarter turns.