Fixed a bug that returned the wrong filename for an uploaded image
This commit is contained in:
parent
298ea458ca
commit
aec829ad85
@ -23,8 +23,8 @@ func SaveImage(c *Config, src io.Reader) (string, error) {
|
|||||||
img = imaging.Resize(img, c.MaxImgWidth, 0, imaging.Lanczos)
|
img = imaging.Resize(img, c.MaxImgWidth, 0, imaging.Lanczos)
|
||||||
}
|
}
|
||||||
|
|
||||||
filename := fmt.Sprint(c.PicsDir, "/", uuid.New(), ".webp")
|
filename := fmt.Sprint(uuid.New(), ".webp")
|
||||||
file, err := os.Create(filename)
|
file, err := os.Create(c.PicsDir + "/" + filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("error creating new image file: %v", err)
|
return "", fmt.Errorf("error creating new image file: %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user