src/gui/image/qimagereader.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
--- a/src/gui/image/qimagereader.cpp	Tue Jul 06 15:10:48 2010 +0300
+++ b/src/gui/image/qimagereader.cpp	Wed Aug 18 10:37:55 2010 +0300
@@ -141,6 +141,18 @@
 #ifndef QT_NO_IMAGEFORMAT_PNG
 #include <private/qpnghandler_p.h>
 #endif
+#ifndef QT_NO_IMAGEFORMAT_JPEG
+#include <private/qjpeghandler_p.h>
+#endif
+#ifndef QT_NO_IMAGEFORMAT_MNG
+#include <private/qmnghandler_p.h>
+#endif
+#ifndef QT_NO_IMAGEFORMAT_TIFF
+#include <private/qtiffhandler_p.h>
+#endif
+#ifdef QT_BUILTIN_GIF_READER
+#include <private/qgifhandler_p.h>
+#endif
 
 QT_BEGIN_NAMESPACE
 
@@ -153,6 +165,18 @@
 #ifndef QT_NO_IMAGEFORMAT_PNG
     _qt_PngFormat,
 #endif
+#ifndef QT_NO_IMAGEFORMAT_JPEG
+    _qt_JpgFormat,
+#endif
+#ifndef QT_NO_IMAGEFORMAT_MNG
+    _qt_MngFormat,
+#endif
+#ifndef QT_NO_IMAGEFORMAT_TIFF
+    _qt_TifFormat,
+#endif
+#ifdef QT_BUILTIN_GIF_READER
+    _qt_GifFormat,
+#endif
     _qt_BmpFormat,
 #ifndef QT_NO_IMAGEFORMAT_PPM
     _qt_PpmFormat,
@@ -179,6 +203,18 @@
 #ifndef QT_NO_IMAGEFORMAT_PNG
     {_qt_PngFormat, "png"},
 #endif
+#ifndef QT_NO_IMAGEFORMAT_JPEG
+    {_qt_JpgFormat, "jpg"},
+#endif
+#ifndef QT_NO_IMAGEFORMAT_MNG
+    {_qt_MngFormat, "mng"},
+#endif
+#ifndef QT_NO_IMAGEFORMAT_TIFF
+    {_qt_TifFormat, "tif"},
+#endif
+#ifdef QT_BUILTIN_GIF_READER
+    {_qt_GifFormat, "gif"},
+#endif
     {_qt_BmpFormat, "bmp"},
 #ifndef QT_NO_IMAGEFORMAT_PPM
     {_qt_PpmFormat, "ppm"},
@@ -301,9 +337,25 @@
     if (!handler && !testFormat.isEmpty()) {
         if (false) {
 #ifndef QT_NO_IMAGEFORMAT_PNG
-	} else if (testFormat == "png") {
+        } else if (testFormat == "png") {
             handler = new QPngHandler;
 #endif
+#ifndef QT_NO_IMAGEFORMAT_JPEG
+        } else if (testFormat == "jpg" || testFormat == "jpeg") {
+            handler = new QJpegHandler;
+#endif
+#ifndef QT_NO_IMAGEFORMAT_MNG
+        } else if (testFormat == "mng") {
+            handler = new QMngHandler;
+#endif
+#ifndef QT_NO_IMAGEFORMAT_TIFF
+        } else if (testFormat == "tif" || testFormat == "tiff") {
+            handler = new QTiffHandler;
+#endif
+#ifdef QT_BUILTIN_GIF_READER
+        } else if (testFormat == "gif") {
+            handler = new QGifHandler;
+#endif
 #ifndef QT_NO_IMAGEFORMAT_BMP
         } else if (testFormat == "bmp") {
             handler = new QBmpHandler;
@@ -380,6 +432,30 @@
                     handler = new QPngHandler;
                 break;
 #endif
+#ifndef QT_NO_IMAGEFORMAT_JPEG
+            case _qt_JpgFormat:
+                if (QJpegHandler::canRead(device))
+                    handler = new QJpegHandler;
+                break;
+#endif
+#ifndef QT_NO_IMAGEFORMAT_MNG
+            case _qt_MngFormat:
+                if (QMngHandler::canRead(device))
+                    handler = new QMngHandler;
+                break;
+#endif
+#ifndef QT_NO_IMAGEFORMAT_TIFF
+            case _qt_TifFormat:
+                if (QTiffHandler::canRead(device))
+                    handler = new QTiffHandler;
+                break;
+#endif
+#ifdef QT_BUILTIN_GIF_READER
+            case _qt_GifFormat:
+                if (QGifHandler::canRead(device))
+                    handler = new QGifHandler;
+                break;
+#endif
 #ifndef QT_NO_IMAGEFORMAT_BMP
             case _qt_BmpFormat:
                 if (QBmpHandler::canRead(device))