Skip to main content

Module image_crop

Module image_crop 

Source
Expand description

A crop the user drew, mapped onto the image it is for.

The cropper measures on whatever copy the page showed, and a preview copy may be scaled down. The rectangle carries the size it was measured at, and is scaled to the image itself, upright, as the page showed it.

Structs§

CropRect
A rectangle in the pixels of the copy the cropper showed, sw x sh when it says.

Functions§

crop_gif
Crop an animated GIF without re-encoding it: each frame keeps its own palette, timing, transparency and disposal, clipped to the rectangle. A frame wholly outside it lends its delay to the one before. None when the file can’t be cropped this way (not a GIF, a rectangle outside the canvas, a first frame with nothing inside it); re-encode instead.
map_crop
crop on an image actual in size: scaled from the copy it was measured on, kept inside the image, and kept square when it was drawn square.
upright_dims
The image’s size as shown: EXIF orientation applied, as a webview applies it.