2018-03-05 18:41:42 +08:00
|
|
|
/*
|
|
|
|
Package caire is a content aware image resize library, which can rescale the source image seamlessly
|
|
|
|
both vertically and horizontally by eliminating the less important parts of the image.
|
|
|
|
|
|
|
|
The package provides a command line interface, supporting various flags for different types of rescaling operations.
|
|
|
|
To check the supported commands type:
|
|
|
|
|
2018-03-05 18:48:56 +08:00
|
|
|
$ caire --help
|
2018-03-05 18:41:42 +08:00
|
|
|
|
|
|
|
In case you wish to integrate the API in a self constructed environment here is a simple example:
|
|
|
|
|
2018-03-05 18:48:56 +08:00
|
|
|
package main
|
2018-03-05 18:41:42 +08:00
|
|
|
|
2018-03-05 18:48:56 +08:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"github.com/esimov/caire"
|
|
|
|
)
|
2018-03-05 18:41:42 +08:00
|
|
|
|
2018-03-05 18:48:56 +08:00
|
|
|
func main() {
|
|
|
|
p := &caire.Processor{
|
|
|
|
// Initialize struct variables
|
|
|
|
}
|
2018-03-05 18:41:42 +08:00
|
|
|
|
2018-03-05 18:48:56 +08:00
|
|
|
if err := p.Process(in, out); err != nil {
|
|
|
|
fmt.Printf("Error rescaling image: %s", err.Error())
|
|
|
|
}
|
2018-03-05 18:41:42 +08:00
|
|
|
}
|
|
|
|
*/
|
|
|
|
package caire
|