diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-05 15:07:36 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-05 15:07:36 (GMT) |
commit | c6ac9fe2e8d219bb9694efaf5b25ec5108fb8fa6 (patch) | |
tree | 917da74f21248a79c2479d5cbe3ba869ea00ff96 /src/plugins | |
parent | 8d5c19f024c55fca61c9cb343180e9db9d79929a (diff) | |
parent | 647b3395e41827c232fa9203ee0590da2b6d257a (diff) | |
download | Qt-c6ac9fe2e8d219bb9694efaf5b25ec5108fb8fa6.zip Qt-c6ac9fe2e8d219bb9694efaf5b25ec5108fb8fa6.tar.gz Qt-c6ac9fe2e8d219bb9694efaf5b25ec5108fb8fa6.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Fix for torn off menus that were way too big
Compile fix for Windows Mobile and OpenGLES2
Fixed failure to store certain image formats as jpeg
Fixa few warnings on mingw
Added QImage::bitPlaneCount().
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/imageformats/jpeg/qjpeghandler.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index 3555b21..6eed824 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -562,11 +562,29 @@ inline my_jpeg_destination_mgr::my_jpeg_destination_mgr(QIODevice *device) free_in_buffer = max_buf; } +static bool can_write_format(QImage::Format fmt) +{ + switch (fmt) { + case QImage::Format_Mono: + case QImage::Format_MonoLSB: + case QImage::Format_Indexed8: + case QImage::Format_RGB888: + case QImage::Format_RGB32: + case QImage::Format_ARGB32: + case QImage::Format_ARGB32_Premultiplied: + return true; + break; + default: + break; + } + return false; +} static bool write_jpeg_image(const QImage &sourceImage, QIODevice *device, int sourceQuality) { bool success = false; - const QImage image = sourceImage; + const QImage image = can_write_format(sourceImage.format()) ? + sourceImage : sourceImage.convertToFormat(QImage::Format_RGB888); const QVector<QRgb> cmap = image.colorTable(); struct jpeg_compress_struct cinfo; |