Details
-
Bug
-
Resolution: Incomplete
-
P3: Somewhat important
-
None
-
4.7.0
-
None
Description
QImageReader::size "Returns the size of the image, without actually reading the image contents.", according to the docs.
With SVG files this isn't true - it seems to read the entire file:
QVariant QSvgIOHandler::option(ImageOption option) const
{
switch(option) {
...
...
case Size:
d->load(device()); – THIS LOADS THE WHOLE SVG
return d->defaultSize;
break;
Surely all that is needed (in most cases at least) is to return the width and height attributes of the outermost svg element?
It will also return an incorrect result if the size in the SVG file isn't specified in pixel units.
According to the SVG Tiny spec, "the 'width' and 'height' attributes on the outermost 'svg' element can specify values in any of the following CSS units: in, cm, mm, pt, pc, and %."
Qt seems to ignore the actual unit specified, and assume a pixel unit instead.