diff --git a/pkg/photo/upload.go b/pkg/photo/upload.go index a2c0098..fe997da 100644 --- a/pkg/photo/upload.go +++ b/pkg/photo/upload.go @@ -118,6 +118,9 @@ func UploadPhoto(cfg UploadConfig) (string, string, error) { return filename, "", nil } + // Scale profile photos down into consistent sizes. + croppedImg = Scale(croppedImg, image.Rect(0, 0, config.ProfilePhotoWidth, config.ProfilePhotoWidth), draw.ApproxBiLinear) + // Write that to disk, too. log.Debug("Writing cropped image to disk: %s", cropFilename) if err := ToDisk(cropFilename, extension, croppedImg, &cfg); err != nil { @@ -218,6 +221,9 @@ func ReCrop(filename string, x, y, w, h int) (string, error) { return "", err } + // Scale profile photos down into consistent sizes. + croppedImg = Scale(croppedImg, image.Rect(0, 0, config.ProfilePhotoWidth, config.ProfilePhotoWidth), draw.ApproxBiLinear) + // Write it. err = ToDisk(cropFilename, ext, croppedImg, nil) return cropFilename, err