Commit 0454ecf1 authored by Kåre Särs's avatar Kåre Särs
Browse files

Fix color channels being swapped

parent 8f338bda
...@@ -1043,11 +1043,11 @@ void KSaneWidgetPrivate::imageReady(const QImage &image) ...@@ -1043,11 +1043,11 @@ void KSaneWidgetPrivate::imageReady(const QImage &image)
} }
case KSaneWidget::FormatRGB_8_C: { case KSaneWidget::FormatRGB_8_C: {
for (int y = 0; y < image.height(); y++) { for (int y = 0; y < image.height(); y++) {
const uchar *line = image.scanLine(y); const QRgb *line = reinterpret_cast<const QRgb *>(image.scanLine(y));
for (int x = 0; x < image.width(); x++) { for (int x = 0; x < image.width(); x++) {
scanData.append(line[4 * x]); scanData.append(qRed(line[x]));
scanData.append(line[4 * x + 1]); scanData.append(qGreen(line[x]));
scanData.append(line[4 * x + 2]); scanData.append(qBlue(line[x]));
} }
} }
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment