MCPcopy
hub / github.com/safing/portmaster / quickScalePNG

Function quickScalePNG

assets/icons_default.go:70–77  ·  view source on GitHub ↗
(imgData []byte, pixelSize int)

Source from the content-addressed store, hash-verified

68}
69
70func quickScalePNG(imgData []byte, pixelSize int) []byte {
71 scaledImage, err := scalePNGTo(imgData, pixelSize)
72 if err != nil {
73 log.Warningf("failed to scale image (using original): %s", err)
74 return imgData
75 }
76 return scaledImage
77}
78
79func scalePNGTo(imgData []byte, pixelSize int) ([]byte, error) {
80 img, err := png.Decode(bytes.NewReader(imgData))

Callers 1

ScaleColoredIconsToFunction · 0.85

Calls 2

WarningfFunction · 0.92
scalePNGToFunction · 0.85

Tested by

no test coverage detected