From e23194b71dbc3fbe30c74f009e94a6049a4c7f1e Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 5 Jan 2023 20:35:45 +0100 Subject: [PATCH] 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 --- modules/image/image.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/image/image.go b/modules/image/image.go index 864260b..7ca833b 100644 --- a/modules/image/image.go +++ b/modules/image/image.go @@ -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 {