(imgData []byte, pixelSize int)
| 68 | } |
| 69 | |
| 70 | func 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 | |
| 79 | func scalePNGTo(imgData []byte, pixelSize int) ([]byte, error) { |
| 80 | img, err := png.Decode(bytes.NewReader(imgData)) |
no test coverage detected