Lazy Loading & Pagination, Alpha Channel -> White Conversion, Add Height & Width to DB & API
This commit is contained in:
@@ -90,6 +90,11 @@ func resizeAndConvertImage(path string, desiredWidth int) ([]byte, error) {
|
||||
return imageBytes, err
|
||||
}
|
||||
|
||||
// Convert Alpha Channel to White (if applicable)
|
||||
if inputImage.HasAlpha() {
|
||||
inputImage.Flatten(&vips.Color{R: 255, G: 255, B: 255})
|
||||
}
|
||||
|
||||
// Convert
|
||||
ep := vips.NewJpegExportParams()
|
||||
ep.Quality = desiredQuality
|
||||
|
||||
Reference in New Issue
Block a user