Documentation ¶
Index ¶
- func Cropped(ext string, read io.ReadSeeker, x1, y1, x2, y2 int) (cropped io.ReadSeeker, err error)
- func FixJpgOrientation(data []byte) (oriented []byte)
- func MaybePreprocessImage(filename string, data []byte, width, height int) (resized io.ReadSeeker, w int, h int)
- func Resized(ext string, read io.ReadSeeker, width, height int, mode string) (resized io.ReadSeeker, w int, h int)
- type DecodeOpts
- type FlipDirection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cropped ¶
func Cropped(ext string, read io.ReadSeeker, x1, y1, x2, y2 int) (cropped io.ReadSeeker, err error)
func FixJpgOrientation ¶
many code is copied from http://camlistore.org/pkg/images/images.go
func MaybePreprocessImage ¶
func MaybePreprocessImage(filename string, data []byte, width, height int) (resized io.ReadSeeker, w int, h int)
* Preprocess image files on client side. * 1. possibly adjust the orientation * 2. resize the image to a width or height limit * 3. remove the exif data * Call this function on any file uploaded to SeaweedFS *
Types ¶
type DecodeOpts ¶
type DecodeOpts struct { // Rotate specifies how to rotate the image. // If nil, the image is rotated automatically based on EXIF metadata. // If an int, Rotate is the number of degrees to rotate // counter clockwise and must be one of 0, 90, -90, 180, or // -180. Rotate interface{} // Flip specifies how to flip the image. // If nil, the image is flipped automatically based on EXIF metadata. // Otherwise, Flip is a FlipDirection bitfield indicating how to flip. Flip interface{} }
type FlipDirection ¶
type FlipDirection int
The FlipDirection type is used by the Flip option in DecodeOpts to indicate in which direction to flip an image.
const ( FlipVertical FlipDirection = 1 << iota FlipHorizontal )
FlipVertical and FlipHorizontal are two possible FlipDirections values to indicate in which direction an image will be flipped.
Click to show internal directories.
Click to hide internal directories.