program crash when trimming a solid color image
Posted: 2013-07-11T05:19:27-07:00
note that i still haven't resolved the last issue, but am continuing development in visual studio for now.
I'm writing a program that does a number of IM operations, and am using a small set of pretty much random images as a test set. I'm also using a wide variety of settings, and in one of my test settings, and on one of my test files, the (earlier) crop operation results in a purely white background image (the source is a letter flashcard, but the letter gets cropped out, leaving the blank white space). When trimming this, the program throws a fatal error and crashes.
1) is this a bug that should be fixed? And if so, if someone could point me to the appropriate place to report it, I'd be happy to. I can of course provide the file, but any file which would be trimmed to 0 pixels produces the crash afaik.
2) what is the best workaround? the logical solution would be to check boundingBox() and if it's ==0, then skip trimming -- but unfortunately, calling boundingBox() on the offending image causes the same crash. I *think* there's a way that I can essentially manually calculate the trim results, by taking the min and max colors, or max color distance, or something like that, but A) is that the best solution, and B) how would I go about doing so?
I'm writing a program that does a number of IM operations, and am using a small set of pretty much random images as a test set. I'm also using a wide variety of settings, and in one of my test settings, and on one of my test files, the (earlier) crop operation results in a purely white background image (the source is a letter flashcard, but the letter gets cropped out, leaving the blank white space). When trimming this, the program throws a fatal error and crashes.
1) is this a bug that should be fixed? And if so, if someone could point me to the appropriate place to report it, I'd be happy to. I can of course provide the file, but any file which would be trimmed to 0 pixels produces the crash afaik.
2) what is the best workaround? the logical solution would be to check boundingBox() and if it's ==0, then skip trimming -- but unfortunately, calling boundingBox() on the offending image causes the same crash. I *think* there's a way that I can essentially manually calculate the trim results, by taking the min and max colors, or max color distance, or something like that, but A) is that the best solution, and B) how would I go about doing so?