Images that are not jpeg by format will be converted to jpeg because with the current installable vips version for the server, other formats are not supported with this version
parent
dd10f42325
commit
e23194b71d
|
@ -90,12 +90,15 @@ func SaveImage(fileHeader *multipart.FileHeader, userId string, imagePath string
|
|||
imageHeight = size.Height
|
||||
}
|
||||
|
||||
/*
|
||||
TODO: Remove this part of the conversion once a newer version of vips (>= vips-8.7.4-Sat) is installed (if moved to new server)
|
||||
All image formats that do not correspond to jpeg are converted, because with the currently installed version of vips the processing of other image formats does not work.
|
||||
Installing a new version of vips is too time consuming.
|
||||
This part must be removed once moved to the new server.
|
||||
*/
|
||||
newImage := fileData
|
||||
|
||||
logrus.Println("content-type", fileHeader.Header.Get("Content-Type"))
|
||||
|
||||
if fileHeader.Header.Get("Content-Type") != "image/jpeg" {
|
||||
logrus.Println("here")
|
||||
newImage, err = bimg.NewImage(fileData).Convert(bimg.JPEG)
|
||||
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue