/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
internal/thumb/resample.go
25 строк
698 B
Michael Mayer
Clean-up: Drop imaging and pigo library integrations #5353 #5508 #668
01 апр 2026, 14:47
01 апр 2026, 14:47
812facc
Код
Авторство
О чём код?
package thumb import ( "image" ) // Resample downscales an image and returns it. func Resample(img image.Image, width, height int, opts ...ResampleOption) image.Image { method, filter, _ := ResampleOptions(opts...) switch method { case ResampleFit: return fitImage(img, width, height, filter) case ResampleFillCenter: return fillImage(img, width, height, filter, cropAnchorCenter) case ResampleFillTopLeft: return fillImage(img, width, height, filter, cropAnchorTopLeft) case ResampleFillBottomRight: return fillImage(img, width, height, filter, cropAnchorBottomRight) case ResampleResize: return resizeImage(img, width, height, filter) default: return cloneImage(img) } }