Qt-interest Archive, March 2008
Strange behavior of some TIFF image after scaling through QGraphicsView & QGraphicsScene & QGraphicsPixmapItem & QPixmap
Message 1 in thread
Hello,
I am trying to write simple widget, that will render image allowing to zoom and scroll it.
I inherited from QGraphicsView, created QGraphicsScene and added to scene QGraphicsPixmapItem with pixmap. Scrolling realized through QGraphicsView::scale().
But I have problem with scaling one image, I tried to draw it with "Ported Canvas Example" from Qt demos, and there this problem emerges too!
First drawing image at 100% scale succeeds (as drawing at any random scales), but later if I scale pixmap back to 100% application draws random screen area instead of image -- like pointer to pixmap memory was corrupted.
I observed this behavior only on one TIFF image:
http://vr1.jino-net.ru/qt/off_luv32.tif
This bug can be repeated this way:
Running "Ported Canvas Example" demo with problem image as first argument in command line:
http://vr1.jino-net.ru/qt/gkrellShoot_03-02-08_064216.jpg
Pressing Ctrl+- -- scene zooming out:
http://vr1.jino-net.ru/qt/gkrellShoot_03-02-08_064304.jpg
Pressing Ctrl++ -- scene zooming in:
http://vr1.jino-net.ru/qt/gkrellShoot_03-02-08_064326.jpg
-- there is seen some random areas from screen instead of 100% scaled images.
Next random pressing Ctrl++ Ctrl+- shows, that only image at scale 100% draws incorrectly.
I'm new to Qt, but seems that problem not in how demo is written (or my simple program), but in internal loading of some TIFF format images (or my hardware/configuration).
Is this bug only problem of my configuration? And if not, what to do with it?
Thanks!
--
[ signature omitted ]
Message 2 in thread
- Subject: Re: Strange behavior of some TIFF image after scaling through QGraphicsView & QGraphicsScene & QGraphicsPixmapItem & QPixmap
- From: Bob Rutsky <altsysrq@xxxxxxxxx>
- Date: Sun, 2 Mar 2008 14:59:42 +0300
- Delivered-to: qt-interest@trolltech.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:from; bh=Mjtt0Y1p8l5gsuhB2Ecld8g1/3oYkdyMv9wlw7xUyWw=; b=UjjcA1cy6iPK56BiipzMqDXBZVrSYE+ng+PWSESGNqxCBjZuCav91mWURluy88YYwmLkpwXR1FkrwnV3L2WoWcoW8+DlzeaxT0KzEq6Mm4wpuwUYQ9XRf1+afwZQCTC0ew6uLgu82jkYHJza/3KyCQHfaTVogJ7bTOjDLxv4Lrg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:from; b=dtqBp04QxT6e+4coXTeE1Fq/0FlZKiG8M11cuyytZkuSNRy+BpbY1N6VV7/HFJUAiUIOYIbP70X9SliKpo6dcCH50vWBFhKVOm6OAVBpynXFWspKUlyimLBNPZjmjfjS+w4VYGPJ6aAV8VFPEYSHl2yRh0tCUIOS1ZoWMxAX4C4=
- List-help: <mailto:qt-interest-request@trolltech.com?subject=help>
- List-post: <mailto:qt-interest@trolltech.com>
- List-subscribe: <mailto:qt-interest-request@trolltech.com?subject=subscribe>
- List-unsubscribe: <mailto:qt-interest-request@trolltech.com?subject=unsubscribe>
- Resent-from: qt-interest@xxxxxxxxxxxxx
- Resent-message-id: <eLdQUB.A.cKF.DbpyHB@esparsett>
- Resent-sender: qt-interest-request@xxxxxxxxxxxxx
- To: qt-interest@xxxxxxxxxxxxx
I forgot to write my configuration:
* 64 bit Debian testing (2.6.22 kernel)
* Qt 4.3.3 from Debian package, demos from documentation package of the same version
* Xorg 7.1, using fglrx drivers (ATI) 8.45.4
* KDE 3.5.8
My program compiled on windows (32 bit) works fine, this bug is not seen.
--
[ signature omitted ]
Message 3 in thread
Hi,
> [...]
> * Xorg 7.1, using fglrx drivers (ATI) 8.45.4
> [...]
That could be the problem. Have you tried with a different driver?
--
[ signature omitted ]
Message 4 in thread
- Subject: Re: Strange behavior of some TIFF image after scaling through QGraphicsView & QGraphicsScene & QGraphicsPixmapItem & QPixmap
- From: Bob Rutsky <altsysrq@xxxxxxxxx>
- Date: Tue, 4 Mar 2008 12:24:48 +0300
- Delivered-to: qt-interest@trolltech.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:from; bh=ZYbbLdpP0d+nLff6zKZxFyopnSJqLpgZkg03B9rtxDw=; b=tEl93PBgdOi7HaeN4uOda9roHyWadBCcFyRUlsgdsU81cQHffkWbBha5eGMYjZXzVbg7nZqxPUyhd7P25otmYc5YzYWljasOrg4Ynt0Wzfn5uY0whwDhx5o7FwIW+U4gP6XcQG/+NNKfuxwFjHbt1qlarRk28WwrDoTUw19Zyyo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:from; b=NAws6G26M81wB3HDavkhnFoIvIsVBbzUnZ80nYG0WrKC4/zQ2a4RNSjGz3bMTV741U+hcno1+KFMlAZzw9xZGkEpPNqPN+x5xhlvNl9ppLiQIelmyvkdUGUYUfWJIsZ5vLQVXKj2gcMQ43Q/U0vUTPEtmPspTk+tWMYZl6UmeoQ=
- List-help: <mailto:qt-interest-request@trolltech.com?subject=help>
- List-post: <mailto:qt-interest@trolltech.com>
- List-subscribe: <mailto:qt-interest-request@trolltech.com?subject=subscribe>
- List-unsubscribe: <mailto:qt-interest-request@trolltech.com?subject=unsubscribe>
- Resent-from: qt-interest@xxxxxxxxxxxxx
- Resent-message-id: <GYlze.A.SdF.CWRzHB@esparsett>
- Resent-sender: qt-interest-request@xxxxxxxxxxxxx
- To: qt-interest@xxxxxxxxxxxxx
Hello,
> > [...]
> > * Xorg 7.1, using fglrx drivers (ATI) 8.45.4
> > [...]
>
> That could be the problem. Have you tried with a different driver?
I tried a little more new ATI driver fglrx 8.45.5 -- not helped.
This effect show only on this one TIFF image, other TIFF or other format images works perfect, so I thought may be this is a problem of format (I thought that may be Qt stores some more optimal structures for diffirent image formats or something else more clever...).
I tried to run demo on same as my configuration (Debian GNU/Linux, AMD 64 bit) but with NVidia graphics adapter -- bug is not reproduced.
Seems that this is video driver + Xorg +configuration bug...
Thanks for your respond, Dimitri!
--
[ signature omitted ]
Message 5 in thread
Hi,
> This effect show only on this one TIFF image, other TIFF or other format images works perfect, so I thought may be this is a problem of format (I thought that may be Qt stores some more optimal structures for diffirent image formats or something else more clever...).
No, the same image converted to PNG should exhibit the same problem, unless
some information such as transparency is lost during the conversion.
You could double-check the properties of the QPixmap the TIFF image is loaded
into:
http://doc.trolltech.com/4.3/qpixmap.html#pixmap-information
height()
width()
depth()
hasAlpha()
hasAlphaChannel()
You might find the bug happens only with QPixmaps with specific properties. If
so, working around the problem could be just a matter of modifying the QPixmap
after loading or while loading it.
> Seems that this is video driver + Xorg +configuration bug...
Yes, it's most probably a driver bug.
--
[ signature omitted ]
Message 6 in thread
Hi,
> I observed this behavior only on one TIFF image:
> http://vr1.jino-net.ru/qt/off_luv32.tif
>
> This bug can be repeated this way:
> Running "Ported Canvas Example" demo with problem image as first argument in command line:
> http://vr1.jino-net.ru/qt/gkrellShoot_03-02-08_064216.jpg
I cannot reproduce the problem.
Also the format of the image on disk should not be relevant. Whether the image
file format is TIFF, PNG or whatever else, the final image in memory should be
identical.
> Pressing Ctrl+- -- scene zooming out:
> http://vr1.jino-net.ru/qt/gkrellShoot_03-02-08_064304.jpg
>
> Pressing Ctrl++ -- scene zooming in:
> http://vr1.jino-net.ru/qt/gkrellShoot_03-02-08_064326.jpg
> -- there is seen some random areas from screen instead of 100% scaled images.
Such problems are usually caused by the graphics driver. Try a more recent
version of the graphics driver or contact the graphics driver vendor if you
already have the most recent driver.
--
[ signature omitted ]