QImage : trouble with save() method
Hello All!
Consider the following simple code example
//////////////////////////////////////////////////////////////////////
#include<QtGui>
int main(int argc, char** argv)
{
QImage img("1.png","png");
assert(img.save("1.jpg","jpg")); // BOOM
//assert(img.save("1.jpeg","jpeg")); // BOOM
//assert(img.save("2.png","png")); // Works fine
}
//////////////////////////////////////////////////////////////////////
Can I save my image as JPEG???
P.S.
QT-4.0.1
MinGW gcc-3.4
Re: QImage : trouble with save() method
JPEG is comercial format you havent support it in free windows version of qt library
Re: QImage : trouble with save() method
Quote:
Originally Posted by krivenok
Can I save my image as JPEG???
Make sure you have compiled Qt with JPEG support (configure -qt-libjpeg or configure -system-libjpeg). There should be qjpeg1.dll and libqjpeg1.a in %QTDIR%\plugins\imageformats.
Quote:
Originally Posted by zlatko
JPEG is comercial format you havent support it in free windows version of qt library
What makes you think so?
Re: QImage : trouble with save() method
My %QTDIR%\plugins\imageformats
-rw-r--r-- 1 krivenok Administ 2150 Feb 21 22:05 libqjpeg1.a
-rw-r--r-- 1 krivenok Administ 2160 Feb 21 22:05 libqjpegd1.a
-rw-r--r-- 1 krivenok Administ 2146 Feb 21 22:06 libqmng1.a
-rw-r--r-- 1 krivenok Administ 2150 Feb 21 22:05 libqmngd1.a
-rwxr-xr-x 1 krivenok Administ 152576 Feb 21 22:05 qjpeg1.dll
-rwxr-xr-x 1 krivenok Administ 924773 Feb 21 22:05 qjpegd1.dll
-rwxr-xr-x 1 krivenok Administ 311808 Feb 21 22:06 qmng1.dll
-rwxr-xr-x 1 krivenok Administ 1385962 Feb 21 22:05 qmngd1.dll
Re: QImage : trouble with save() method
What does QImageWriter::supportedImageFormats() return?
Re: QImage : trouble with save() method
It returns:
bmp
png
ppm
xbm
xpm
Re: QImage : trouble with save() method
Maybe JPEG plugin is unavailable?
Re: QImage : trouble with save() method
Quote:
Originally Posted by jacek
What makes you think so?
It was in interesing arhive for qt3 windows non comercial
http://lists.trolltech.com/qt-intere...ad00008-0.html
Re: QImage : trouble with save() method
Date of message : Sun, 1 Jul 2001 :)
Re: QImage : trouble with save() method
Quote:
Originally Posted by krivenok
Date of message : Sun, 1 Jul 2001 :)
Yes but i dont think that licensed policy changed frequently :rolleyes:
ps. it just IMHO...i actually never try use win free version :)
Re: QImage : trouble with save() method
Quote:
Originally Posted by krivenok
It returns:
bmp
png
ppm
xbm
xpm
Strange, I have Qt 4.1.2 and this list also includes "jpeg" and "jpg". Try to copy that qjpeg1.dll to a "imageformats" subdirectory in the directory where your executable is.
Re: QImage : trouble with save() method
Quote:
Originally Posted by jacek
Strange, I have Qt 4.1.2 and this list also includes "jpeg" and "jpg". Try to copy that qjpeg1.dll to a "imageformats" subdirectory in the directory where your executable is.
No effect :(
Re: QImage : trouble with save() method
Quote:
Originally Posted by krivenok
No effect :(
For some reason it doesn't like that plugin. How did you install Qt?