You've already forked imgproxy
mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-11-29 23:07:40 +02:00
Fix sizes of GIF and ICO before save
This commit is contained in:
@@ -31,6 +31,8 @@ type Image struct {
|
||||
var (
|
||||
typeSupportLoad sync.Map
|
||||
typeSupportSave sync.Map
|
||||
|
||||
gifResolutionLimit int
|
||||
)
|
||||
|
||||
var vipsConf struct {
|
||||
@@ -69,6 +71,8 @@ func Init() error {
|
||||
C.vips_cache_set_trace(C.gboolean(1))
|
||||
}
|
||||
|
||||
gifResolutionLimit = int(C.gif_resolution_limit())
|
||||
|
||||
vipsConf.JpegProgressive = gbool(config.JpegProgressive)
|
||||
vipsConf.PngInterlaced = gbool(config.PngInterlaced)
|
||||
vipsConf.PngQuantize = gbool(config.PngQuantize)
|
||||
@@ -183,6 +187,10 @@ func SupportsSave(it imagetype.Type) bool {
|
||||
return sup
|
||||
}
|
||||
|
||||
func GifResolutionLimit() int {
|
||||
return gifResolutionLimit
|
||||
}
|
||||
|
||||
func gbool(b bool) C.gboolean {
|
||||
if b {
|
||||
return C.gboolean(1)
|
||||
|
||||
Reference in New Issue
Block a user