Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
4.5.0
-
None
Description
The bug is picky about image sizes. The width of the image after scaling must be divisible by 8 and it only occurs for jpegs.
This is probably the same bug as #238083, I reported it because there is no "12 pixels" here, the entire rightmost pixel column is affected, and the demo code might be useful.
In the following example the resulting smallwhite.png is all-white except for the rightmost pixel column which appears to be filled with uninitialized data (usually zeros so it gets black)
example code:
#include <QApplication>
#include <QImage>
#include <QImageReader>
int main( int argc, char **argv )
{
QApplication app( argc, argv );
QImage big(3264,2448, QImage::Format_RGB32);
big.fill(0xffffffff);
big.save("bigwhite.jpg");
QImageReader reader("bigwhite.jpg");
reader.setScaledSize(QSize(200,150)); // width divisible by 8
QImage img = reader.read();
img.save("smallwhite.png");
return 0;
}