Hello Dan,
I would definitely echo the fuzzing suggestion from Jake.
In addition, in your quest to find broken images, I would suggest grabbing the images from the dvyukov/go-fuzz corpus, which has a bunch of images that are already broken in "creative" ways for you based on the coverage-guided fuzzing that has happened these in the past. For example, here are a bunch of images from there:
You could just use those as inputs to your tests now, even if you don't want to fuzz anything yet. There are also other public fuzzing corpuses for other languages or image libraries that you can find to run your tests against.
That go-fuzz corpus repository also contains sample fuzzing functions for jpeg, png, and gif so that you don't have to start from scratch to fuzz your changes.
Also, some of those fuzzing functions from the go-fuzz corpus have also somewhat recently been moved into the Go standard library. For example, acln0 moved the png fuzz function from the go-fuzz corpus into the Go standard library.
I mention that in part because as part of your effort to make sure you are not introducing bugs, you could consider bringing over the jpeg and gif fuzzing functions from the go-fuzz corpus into the Go standard library, which would help exercise your code (including it would then be a ~2 line PR to google/oss-fuzz to pick up continuous fuzzing funded by Google for those new functions, which would give you on-going coverage of your changes).
Finally, one way to fuzz using the fuzzing functions in the standard library (using image/png as the example here) is as follows:
$ fzgo test -fuzz=. image/png
fzgo is a wrapper on top of go-fuzz that provides some additional conveniences, but perhaps more interesting is that fzgo is a simple prototype of how cmd/go could behave under the proposal in #19109:
#19109 proposal: make fuzzing a first class citizen, like tests or benchmarks
Sorry for the long post, but I believe you'll get pretty quick payback on the small amount of time it would take to start fuzzing your changes via some of the starting points listed above.
Regards,
thepudds