beetlebug▾
/

ztk::photo orient

Turns and mirrors a photo so an image of an EXIF orientation shows upright.

ztk::photo orient SRC DST ORIENTATION

Description

ORIENTATION is a value of orientation: 1 keeps the image; 2 and 4 mirror it left to right and top to bottom; 3 turns it by 180 degrees; 6 and 8 turn it by 90 degrees clockwise and anticlockwise; 5 and 7 mirror it on a diagonal.

Returns

An empty string.

Examples

% image create photo o -width 2 -height 1
> o put {{red blue}}
> ztk::photo orient o o 6
> list [image width o] [image height o] [o get 0 0]
1 2 {255 0 0}

Errors

% image create photo o2 -width 1 -height 1; ztk::photo orient o2 o2 9
bad orientation "9": must be 1 to 8
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.10