anthonynsimon / bild

Image processing algorithms in pure Go
MIT License
3.97k stars 213 forks source link

Rotate() results in panic on some images #60

Closed cheston97 closed 5 years ago

cheston97 commented 6 years ago

I've encountered some images for which the Rotate() function results in: runtime error: slice bounds out of range

The error seems to be happening on rotate.go:111: copy(dst.Pix[dstPos:dstPos+4], src.Pix[srcPos:srcPos+4])

An image that can reproduce the error: https://static.thumbtackstatic.com/pictures/61/41zcu25h98b0rquu.jpg

FWIW, opening that image in an editor (e.g. Preview on mac) and simply re-saving it seems to resolve the issue. Unsure what to make of that.

Please let me know if I can provide any more info!

ghost commented 5 years ago

I would like to look into this, if its okay ?

ghost commented 5 years ago

Short follow up, are there any other images that seem not to work ? Because given image: https://static.thumbtackstatic.com/pictures/61/41zcu25h98b0rquu.jpg works just fine on my mac.

cheston97 commented 5 years ago

Sorry, I don't have any others available, and we migrated our image manipulation to another library, so I don't have an easy way to try to repro. Sorry!

anthonynsimon commented 5 years ago

No worries :)

I guess we can close the issue for now, at least until we can find a case that reproduces it.