REPRODUCIBILITY: 100%
OS VERSION: > 3.4
HARDWARE: vollaphone/gigaset gs290, XA2, Xperia 10 ii
UI LANGUAGE: en
REGRESSION: YES
DESCRIPTION:
Give an Image and a Canvas, calling something like drawingCanvas.requestPaint() causes the Image to be rendered in the Canvas with a blue tint. An example in @kimmolindholm s paint (which I’m trying to resurrect):
Ah, I was thinking it had something to do with QT, but HAL, > 3.4 could be the culprit. However, I believe, the tint in html image in richtext Labels was also present in 3.4. The issue with paint was/is not. I’m uncertain since there are some issues on the Vollaphone, so I’d appreciate if people tested the build of ‘Paint’ that I’ve made available on chum and open repos.
@attah just confirmed that the compositing issue reported here does not appear on official sony devices. If anyone with other ports could try the paint app at Paint | OpenRepos.net — Community Repository System (also on chum) to share if importing image and compositing leads to a tint, that would be really helpful.
Not exactly. Inverted / negative would be more dramatic If you take the blue highway and run the RGB-BRG swap it’s almost normal. @attah had showed QML Label dispays images with a blue-ish tint - #13 by attah a method for get back swapping Red and Green, I believe. I’ll implement a filter in paint!
On a tip from @attah I implemented a format conversion which works for me. I’d appreciate feedback. Is this a fix for an original ‘error’ in implementation?
If I was to guess what’s happening, since the QML Canvas.loadImage has neither the correct Orientation from meta, nor the correct order of color channels, it looks like Autotransform/Autocolor are not being used? I haven’t been able to find the code, but on simplifying my above fix, I did a dead simple test.
class ImageProvider : public QQuickImageProvider
...
QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize)
{
Q_UNUSED(requestedSize)
QString filename = QUrl(id).toString(QUrl::RemoveScheme);
QImage img;
QSize originalSize;
QByteArray format;
QImageReader ir(filename);
ir.setAutoTransform(true);
if (!ir.canRead())
return img;
originalSize = ir.size();
format = ir.format();
if (size)
*size = originalSize;
img = ir.read();
if (requestedSize.isValid())
return img.scaled(requestedSize.width(), requestedSize.height(), Qt::KeepAspectRatio);
else
return img;
}
passed to canvas with: “image://paintImage/” …
in Volla/GS290 number one. SailfishOS_3_4_0_24_armv7hl_in_Sailfish_SDK_Build_Engine-Debug
this yields correct orientation and color
in Volla/GS290 number two, and Xperia 10ii SailfishOS_4_4_0_58_aarch64_in_Sailfish_SDK_Build_Engine-Debug
orientation is correct, color is Red swapped with Blue.
I wonder, if there’s some confusion in RGBA vs ARGB in some components of Qt/Lipsick/Silica, would that maybe also explain the high CPU usage for “rgba” elements found and documented by @leszek?
Or rather, are these copy operations particularly expensive?