Yes good point, take care those built-in size attributes are optional, might 
not be there into an SVG, you might not want to count on it.

From: Interest <interest-boun...@qt-project.org> on behalf of Giuseppe D'Angelo 
via Interest <interest@qt-project.org>
Date: Tuesday, March 23, 2021 at 10:53 AM
To: interest@qt-project.org <interest@qt-project.org>
Subject: Re: [Interest] QML Image size vs sourceSize strange things
Il 23/03/21 14:16, Jérôme Godbout ha scritto:
> Do you really need to same memory by reducing the source size? I think
> you should left the source size alone and sample the image from the full
> source. Source size for SVG doesn’t make any sense, it’s vectoriel,
> doesn’t have any size, it can scale to any dimension.

This isn't accurate. SVG files have a builtin "wanted" size, which is
IIRC what Qt would use by default:

> https://www.w3.org/TR/SVG11/struct.html#SVGElementWidthAttribute

By explictly setting `sourceSize` you're asking Qt to rasterize the SVG
at a different resolution rather than the wanted one (and downscaling
when rendering).


My 2 c,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to