Skip to content

Commit

Permalink
FI Optimize Image-Scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
fbury-hec committed Mar 7, 2024
1 parent 734fec6 commit cd84e43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/imgHandler/resize.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func ResizeImage(src_path string, dst_path string, width int) (string, error) {

srcImage, err := imaging.Open(src_path, imaging.AutoOrientation(true))
dstImage800 := imaging.Resize(srcImage, width, 0, imaging.Lanczos)
dstImage800 := imaging.Resize(srcImage, width, 0, imaging.Linear)

// Create the file to which the resized image will be written.
out, err := os.Create(dst_path)
Expand All @@ -21,7 +21,7 @@ func ResizeImage(src_path string, dst_path string, width int) (string, error) {
defer out.Close()

// Encode and write the resized image to the new file.
err = jpeg.Encode(out, dstImage800, nil)
err = jpeg.Encode(out, dstImage800, &jpeg.Options{Quality: 55})
if err != nil {
log.Error(err)
return "", err
Expand Down

0 comments on commit cd84e43

Please sign in to comment.