Bug 951864 - QImage does not support JPEG
Summary: QImage does not support JPEG
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: mingw32-qt
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Erik van Pienbroek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-13 23:20 UTC by Kamae Norihiro
Modified: 2014-02-05 23:07 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-05 23:07:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Kamae Norihiro 2013-04-13 23:20:51 UTC
Description of problem:
In the Qt-project online document, QImage is mentioned to be able to read JPEG format. But The program build by mingw32-qt cannot read JPEG image.

The function QImageReader::supportedImageFormats() does not returns JPEG.

Version-Release number of selected component (if applicable):
mingw32-qt-4.8.4-1.fc18

How reproducible:
Always failed.

Steps to Reproduce:
1. Build the source file below.
2. Execute it on Windows.

$ cat main.cc
#include <QApplication>
#include <QImage>
#include <QImageReader>
#include <cstdio>

int main(int argc, char **argv)
{
	QApplication app(argc, argv);
	QList<QByteArray> list = QImageReader::supportedImageFormats();
	for(int i=0; i<list.size(); i++) {
		const QByteArray &x = list.at(i);
		printf("%s\n", (const char*)x.data());
	}
	return 0;
}
$ cat qimage-jpeg.pro
#! /usr/bin/mingw32-qmake-qt4
SOURCES = main.cc
CONFIG += console

Actual results:
bmp
pbm
pgm
png
ppm
xbm
xpm


Expected results:
bmp
gif
ico
jpeg
jpg
mng
pbm
pgm
png
ppm
svg
svgz
tga
tif
tiff
xbm
xpm


Additional info:
The expected result is the output made by qt-devel-4.8.4-14.fc18.x86_64.

Comment 1 Erik van Pienbroek 2013-04-14 15:40:11 UTC
I just tried to reproduce the testcase you provided using wine and mingw32-qt-4.8.4-2.fc19 and here it shows the expected output:

$ mingw32-qmake-qt4 qimage-jpeg.pro
$ make
make -f Makefile.Release
make[1]: Entering directory `/home/erik/fedora_mingw_testsuite/trunk/testcases/qt4/qimage'
i686-w64-mingw32-g++ -c -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 --param=ssp-buffer-size=4 -fno-keep-inline-dllexport -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I'/usr/i686-w64-mingw32/sys-root/mingw/include/QtCore' -I'/usr/i686-w64-mingw32/sys-root/mingw/include/QtGui' -I'/usr/i686-w64-mingw32/sys-root/mingw/include' -I'/usr/i686-w64-mingw32/sys-root/mingw/include/ActiveQt' -I'release' -I'/usr/i686-w64-mingw32/sys-root/mingw/share/qt4/mkspecs/win32-g++-cross' -o release/main.o main.cc
i686-w64-mingw32-g++ -g -Wl,-subsystem,console -mthreads -o release/qimage-jpeg.exe release/main.o  -L'/usr/i686-w64-mingw32/sys-root/mingw/lib' -lQtGui4 -lQtCore4 
make[1]: Leaving directory `/home/erik/fedora_mingw_testsuite/trunk/testcases/qt4/qimage'
$ cd release
$ wine qimage-jpeg.exe
p11-kit: couldn't load module: /usr/lib/pkcs11/p11-kit-trust.so: /usr/lib/pkcs11/p11-kit-trust.so: cannot open shared object file: No such file or directory
p11-kit: couldn't load module: /usr/lib/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/pkcs11/gnome-keyring-pkcs11.so: cannot open shared object file: No such file or directory
bmp
gif
ico
jpeg
jpg
mng
pbm
pgm
png
ppm
svg
svgz
tga
tif
tiff
xbm
xpm

I do have to notice that libjpeg-62.dll is in my PATH. Is this library also bundled with your executable?

Comment 2 Kamae Norihiro 2013-04-14 16:56:35 UTC
If I run it on Windows Server 2008 R2 not wine, JPEG is not included.

I copied libgcc_s_sjlj-1.dll libjpeg-62.dll libpng15-15.dll libstdc++-6.dll libopenjpeg.dll libturbojpeg.dll QtCore4.dll QtGui4.dll zlib1.dll from /usr/i686-w64-mingw32/sys-root/mingw/bin/ to the directory containing qimage-jpeg.exe.

I also confirm that JPEG is included in wine environment and it work as you showed.

Comment 3 Erik van Pienbroek 2013-05-04 20:02:01 UTC
Qt has support for optional image formats. These optional image formats are all implemented in special plugin dll's which can be found in /usr/i686-w64-mingw32/sys-root/mingw/lib/qt4/plugins/imageformats. To get JPEG support in Qt you need to bundle qjpeg4.dll which can be found in the mentioned folder along with your application.

To make Qt able to detect these optional image formats you need to create a folder called 'imageformats' and put all image format plugins you desire in it. 

In your case you would end up with this file/directory structure:
myapp\qimage-jpeg.exe
myapp\libgcc_s_sjlj-1.dll
myapp\libjpeg-62.dll
myapp\libpng15-15.dll
myapp\libstdc++-6.dll
myapp\QtCore4.dll
myapp\QtGui4.dll
myapp\zlib1.dll
myapp\imageformats\qjpeg4.dll

Comment 4 Fedora End Of Life 2013-12-21 15:28:44 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Fedora End Of Life 2014-02-05 23:07:54 UTC
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.