Closed threeifbywhiskey closed 10 years ago
Cool. Can you also add some tests to the test suite to verify it's behaviour?
Hey, Willem. The tests I've added aren't particularly thorough, but I hope they're enough for you to consider the new functionality covered. If not, I'd be happy to add a bit more. Either way, thanks for taking time out to give the new code a look. :smile:
The cosmetic changes are OK. You can see the diff with whitespace changes ignored by adding ?w=1
to the url: https://github.com/wvanbergen/chunky_png/pull/46/files?w=1
Except for my question, this looks good to me! By the way, I pushed a fix to the master branch that should fix the CI runs.
The ?w=1
trick is convenient, but I still pale at cluttering up my pull request. Thanks for not taking umbrage, of course. I noticed the Travis build had failed and wondered if I'd broken something, but the error message didn't seem to indicate it being my doing; I'm glad you could diagnose the issue and operate. :smiley:
Other than my potential mistake regarding that one line, it would seem images are now trim-able. Thanks for accepting my contribution, Willem. I look forward to several more in future if and when inspiration strikes.
I suppose it's not a particularly useful feature given how long ChunkyPNG has been around, but every now and then one needs to trim a solid border of color from around an image, and this pull request provides that functionality. I had a nil check in at first, but that turned out to be unnecessary. This is my first contribution to an open-source project, so I hope it makes it in. :sweat_smile: