[Qt-interest] jpeg quality ignored when it is saved to a QBuffer
hakiim the dream
hakiim35 at hotmail.com
Fri Jun 25 13:05:01 CEST 2010
Hi, I am trying to make a simple image viewer which will support updating the jpeg image in a preview dialog and save the updated image to the disk. The following code block is from my updateImage method: .......................................................................QByteArray ba;QBuffer buffer(&ba); buffer.open(QIODevice::WriteOnly);imgOriginal->save(&buffer, "jpeg", t->getQuality());imageCurrent.load(&buffer, "jpeg");imageCurrent.save("C:/untitled.jpeg", "jpeg");......................................................................Whenever I move the slider which controls the quality token (between 0-100) , the updateImage method is called. But unfortunately, the updated image in the preview is always the original image, and also the saved image is always the original one.So, why does writing to a QBuffer with the quality parameter set, and reading back from the buffer not work?Thanks.
_________________________________________________________________
Yeni Windows 7: Gündelik işlerinizi basitleştirin. Size en uygun bilgisayarı bulun.
http://windows.microsoft.com/shop
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100625/351f8134/attachment.html
More information about the Qt-interest-old
mailing list