mirror of
https://github.com/tenox7/wrp.git
synced 2025-01-04 13:29:54 +00:00
use form image size
This commit is contained in:
parent
bb29ce38de
commit
335a84f52e
7
txt.go
7
txt.go
@ -2,15 +2,14 @@
|
||||
package main
|
||||
|
||||
// TODO:
|
||||
// - image type based on form value
|
||||
// - also size and quality
|
||||
// - imgOpt image quality
|
||||
// - imgOpt image quality for jpeg
|
||||
// - non overlaping image names atomic.int etc
|
||||
// - garbage collector / delete old images from map
|
||||
// - add referer header
|
||||
// - svg support
|
||||
// - incorrect cert support in both markdown and image download
|
||||
// - unify cdp and txt image handlers
|
||||
// - use goroutiness to process images
|
||||
// - BOG: DomainFromURL always prefixes with http instead of https
|
||||
// reproduces on vsi vms docs
|
||||
// - BUG: markdown table errors
|
||||
@ -146,7 +145,7 @@ func smallImg(src []byte, imgType string, maxSize, imgOpt int) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("image decode problem: %v", err)
|
||||
}
|
||||
img = resize.Thumbnail(uint(*defImgSize), uint(*defImgSize), img, resize.NearestNeighbor)
|
||||
img = resize.Thumbnail(uint(maxSize), uint(maxSize), img, resize.NearestNeighbor)
|
||||
var outBuf bytes.Buffer
|
||||
switch imgType {
|
||||
case "png":
|
||||
|
Loading…
Reference in New Issue
Block a user