mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +00:00
Improve image api.
This commit is contained in:
@@ -110,7 +110,11 @@ func CreateImage(uid uint, ip string, data []byte) (uint, error) {
|
||||
|
||||
// If the image is still too large after conversion, return an error
|
||||
if len(data) > 1024*1024*4 {
|
||||
return 0, model.NewRequestError("Image data is too large after conversion")
|
||||
return 0, model.NewRequestError("Image data is too large")
|
||||
}
|
||||
// Normal user has a smaller upload limit
|
||||
if !canUpload && len(data) > 1024*1024*2 {
|
||||
return 0, model.NewRequestError("Image data is too large")
|
||||
}
|
||||
|
||||
filename := uuid.New().String()
|
||||
|
Reference in New Issue
Block a user