Context: QT, C++, Custom image library, which uses PNM format to save images. I generated a set of small images from a larger image. The image library I use saves image properties in the header of the PNM image. I use these properties in another program that does analysis on the images. I did further editing on some of the small images with GIMP, and then left work for the day.
Problem: Next day, went to run my analysis program on the set of images, and it crashes in the image library. The error message states basically that the index is out of bounds for the image property.
Solution: After modifying the image library to print more debug information, and recompiling the whole library, taking up time figuring out the build system for the library, I discovered that when I had edited the images with GIMP, and re-saved them, GIMP had not preserved the image properties my image library had saved in the header. I regenerated the images from my program, and the analysis program ran fine. If I need to do edits on them, I will have to find a different way to edit them than GIMP.
Lesson: If your program isn't working, check your data sources as well the code itself.
No comments:
Post a Comment