Skip to content

Commit

Permalink
Thumbnail jpgs as jpgs to not increase thumbnail size
Browse files Browse the repository at this point in the history
  • Loading branch information
Sorunome committed Nov 17, 2020
1 parent 4d40676 commit 6f90d5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thumbnailing/i/jpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ func (d jpgGenerator) GenerateThumbnail(b []byte, contentType string, width int,
}

imgData := &bytes.Buffer{}
err = imaging.Encode(imgData, thumb, imaging.PNG)
err = imaging.Encode(imgData, thumb, imaging.JPEG)
if err != nil {
return nil, errors.New("jpg: error encoding thumbnail: " + err.Error())
}
return &m.Thumbnail{
Animated: false,
ContentType: "image/png",
ContentType: "image/jpeg",
Reader: ioutil.NopCloser(imgData),
}, nil
}
Expand Down

0 comments on commit 6f90d5c

Please sign in to comment.