[Qt-interest] QImageWriter says JPEG supported, but won't write JPEG Files

Rainer Wiesenfarth Rainer.Wiesenfarth at inpho.de
Thu Oct 29 17:39:16 CET 2009


From: Josiah Bryan
> I can't seem to get QImageWriter to write out JPEG files, even though 
> the supportedImageFormats() list gives jpeg/jpg as a 
> supported format! 
> (Qt "4.7.0" and 4.5.2 both exhibit this problem)
> 
> I don't get any errors from the QImageWriter API, but the 
> message on the 
> console is:
> 
> QJpegHandler: unable to write image of format 7
> [...]

I took a look at QImage's documentation and it tells me that "format 7" is
QImage::Format_RGB16 (16bit/pixel, 5-6-5). Probably you have to convert your
image to a "more standard" format like QImage::Format_RGB32, using
QImage::convertToFormat().

Best Regards / Mit freundlichen Grüßen
Rainer Wiesenfarth

-- 
INPHO GmbH * Smaragdweg 1 * 70174 Stuttgart * Germany
phone: +49 711 2288 10 * fax: +49 711 2288 111 * web: www.inpho.de
place of business: Stuttgart * managing director: Johannes Saile
commercial register: Stuttgart, HRB 9586
Leader in Photogrammetry and Digital Surface Modelling
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3438 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091029/32943a3a/attachment.bin 


More information about the Qt-interest-old mailing list