Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.0.0
-
None
Description
Requirements:
1. Render images to specified size. Assumption is 100x100
2. Must ensure the image no blurry, then the render pixel size is less than the image pixel size
3. If the image source size is less than the specified size(100x100), should using the image source pixel size
4. If the image can lossless scale(svg), should scale to the specified size
For those requirements.
My first mean is set sourceSize property of Image.
Image {
source: "..."
sourceSize: Qt.size(100, 100)
}
But it isn't accord with the rule 3, because I can't know the image file pixel size(because the sourceSize property of Image is set). and it isn't accord with the rule 2, because if the Window devicePixelRatio is greater then 1.0, and the image file can't lossless scale, and no "@2x" files, the image will blurry.
My second mean is only set width and height properties of Image.
Image { source: "..." width: Math.min(100, sourceSize.width) height: Math.min(100, sourceSize.height) fillMode: PreserveAspectFit }
But is isn't accord with the rule 4, because the sourceSize of lossless svg file is the default size, should always render the svg image to 100x100. and not set the sourceSize, maybe this can lead to unnecessary waste of memory.
Attachments
Issue Links
- relates to
-
QTBUG-122711 QQuickImageProviderWithOptions::loadSize doesn't deal with options correctly
- Reported
-
QTBUG-17269 Using Image.PreserveAspectFit results in inconsistent implicit/source size
- Reported