summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-11-23 10:06:53 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-11-23 10:06:53 (GMT)
commit05ba0b4d0d32ea2a823aee0b5d196008d95a021d (patch)
treed02bf5f2552db299f2a906549f9c51d0f4de8b9d /src/gui/image
parent8960973e97713205d1aeb209806daca456c55111 (diff)
parent787a9ce07accfcaddada8235ae204a5aa2025309 (diff)
downloadQt-05ba0b4d0d32ea2a823aee0b5d196008d95a021d.zip
Qt-05ba0b4d0d32ea2a823aee0b5d196008d95a021d.tar.gz
Qt-05ba0b4d0d32ea2a823aee0b5d196008d95a021d.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-qml-staging: Sequential reading not supported. DeclarativeDebugServer: Instantiate QPluginLoader on heap Fix failing unit tests. qmlplugindump: Fix dumping empty names for generated QMetaObjects. Fix compile with -qtnamespace Properly protect access to pixmap reader thread with mutex Move tga support from Qt3d to Qt. Move tga support from Qt3d to Qt. Properly protect access to pixmap reader thread with mutex qmlplugindump: Add flush to fix output redirection on windows.
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qimagereader.cpp5
-rw-r--r--src/gui/image/qtiffhandler.cpp6
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp
index 411e5e9..2b56e49 100644
--- a/src/gui/image/qimagereader.cpp
+++ b/src/gui/image/qimagereader.cpp
@@ -1473,11 +1473,16 @@ QByteArray QImageReader::imageFormat(QIODevice *device)
\row \o XBM \o X11 Bitmap
\row \o XPM \o X11 Pixmap
\row \o SVG \o Scalable Vector Graphics
+ \row \o TGA \o Targa Image Format
\endtable
Reading and writing SVG files is supported through Qt's
\l{QtSvg Module}{SVG Module}.
+ TGA support only extends to reading non-RLE compressed files. In particular
+ calls to \l{http://doc.qt.nokia.com/4.7-snapshot/qimageioplugin.html#capabilities}{capabilities}
+ for the tga plugin returns only QImageIOPlugin::CanRead, not QImageIOPlugin::CanWrite.
+
To configure Qt with GIF support, pass \c -qt-gif to the \c
configure script or check the appropriate option in the graphical
installer.
diff --git a/src/gui/image/qtiffhandler.cpp b/src/gui/image/qtiffhandler.cpp
index 4dc9775..51a500d 100644
--- a/src/gui/image/qtiffhandler.cpp
+++ b/src/gui/image/qtiffhandler.cpp
@@ -158,7 +158,13 @@ bool QTiffHandler::canRead(QIODevice *device)
// current implementation uses TIFFClientOpen which needs to be
// able to seek, so sequential devices are not supported
+ int pos = device->pos();
+ if (pos != 0)
+ device->seek(0); // need the magic from the beginning
QByteArray header = device->peek(4);
+ if (pos != 0)
+ device->seek(pos); // put it back where we found it
+
return header == QByteArray::fromRawData("\x49\x49\x2A\x00", 4)
|| header == QByteArray::fromRawData("\x4D\x4D\x00\x2A", 4);
}