Lazy Loading & Pagination, Alpha Channel -> White Conversion, Add Height & Width to DB & API

This commit is contained in:
2021-02-28 19:23:41 -05:00
parent 6827a2994a
commit 745d843af7
18 changed files with 427 additions and 284 deletions

View File

@@ -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