The following image of size 1x9 is being trimmed to 1x6 because presumably the pixel at the top is the same color as the pixel at the bottom and in the trim function, these pixels are being identified as the background color, even though the backgroundColor being reported before the execution of the trim function is #FFFFFF.
http://s1.postimage.org/a7r69yxsr/m_medium_bc.png
The only thing I am doing is executing trim on the Image. Explicitly setting backgroundColor and/or transparent() makes no difference.
- Why is this occurring and is this the expected behavior?
- Can this be fixed by configuration/property setting/without changing Graphicsk library code?
- If not, when can this bug be fixed? Do you expect a bug of this nature to be fixed in the next few days?
Here is the code:
Magick::Image tempImage;
tempImage.read(name);
std::cout<<"size:"<<tempImage.columns()<<","<<tempImage.rows()<<std::endl;
temp=tempImage.backgroundColor();
std::cout<<"bg:"<<(std::string)temp<<std::endl;
tempImage.trim();
std::cout<<"size:"<<tempImage.columns()<<","<<tempImage.rows()<<std::endl;