mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-03-22 20:21:28 +02:00
Fix build on 32-bit systems
This commit is contained in:
parent
939a4c18c3
commit
bf64a48783
@ -5,6 +5,7 @@ import (
|
||||
"encoding/hex"
|
||||
"flag"
|
||||
"fmt"
|
||||
"math"
|
||||
"os"
|
||||
"runtime"
|
||||
"strconv"
|
||||
@ -461,14 +462,14 @@ func configure() {
|
||||
|
||||
if conf.DownloadBufferSize < 0 {
|
||||
logFatal("Download buffer size should be greater than or equal to 0")
|
||||
} else if conf.DownloadBufferSize > int(^uint32(0)) {
|
||||
logFatal("Download buffer size can't be greater than %d", ^uint32(0))
|
||||
} else if conf.DownloadBufferSize > math.MaxInt32 {
|
||||
logFatal("Download buffer size can't be greater than %d", math.MaxInt32)
|
||||
}
|
||||
|
||||
if conf.GZipBufferSize < 0 {
|
||||
logFatal("GZip buffer size should be greater than or equal to 0")
|
||||
} else if conf.GZipBufferSize > int(^uint32(0)) {
|
||||
logFatal("GZip buffer size can't be greater than %d", ^uint32(0))
|
||||
} else if conf.GZipBufferSize > math.MaxInt32 {
|
||||
logFatal("GZip buffer size can't be greater than %d", math.MaxInt32)
|
||||
}
|
||||
|
||||
if conf.BufferPoolCalibrationThreshold < 64 {
|
||||
|
4
vips.go
4
vips.go
@ -292,9 +292,7 @@ func (img *vipsImage) Save(imgtype imageType, quality int) ([]byte, context.Canc
|
||||
return nil, cancel, vipsError()
|
||||
}
|
||||
|
||||
const maxBufSize = ^uint32(0)
|
||||
|
||||
b := (*[maxBufSize]byte)(ptr)[:int(imgsize):int(imgsize)]
|
||||
b := (*[math.MaxUint32]byte)(ptr)[:int(imgsize):int(imgsize)]
|
||||
|
||||
return b, cancel, nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user