Re: [Interest] displaying Qt-coded JPEG image in browser

2024-01-26 Thread Alexander Carôt via Interest
Alex -- http://www.carot.de Email : alexan...@carot.de Tel.: +49 (0)177 5719797 > Gesendet: Freitag, 26. Januar 2024 um 16:17 Uhr > Von: "Thiago Macieira" > An: "qt qt" > Cc: "Alexander Carôt" > Betreff: Re: [Interest] displaying Qt-coded JPEG im

Re: [Interest] displaying Qt-coded JPEG image in browser

2024-01-26 Thread Thiago Macieira
On Friday, 26 January 2024 04:55:59 PST Alexander Carôt via Interest wrote: > QString jpgBufferString( finalJpg.data() ); This here will corrupt the data, because you can't load arbitrary binary data into QString like this: it's trying to decode as UTF-8 and failing. > QString encodedString = jp

Re: [Interest] displaying Qt-coded JPEG image in browser

2024-01-26 Thread a...@golks.de
Am 26.01.2024 um 14:36 schrieb Alexander Carôt via Interest: try: QString encodedString = finalJpg.data().toBase64(); Hi, would love to do that but this leads to error: member reference base type 'char *' is not a structure or union that should be, i guess: QString encodedString = finalJp

Re: [Interest] displaying Qt-coded JPEG image in browser

2024-01-26 Thread Alexander Carôt via Interest
> Hi, maybe passing JPG through fromUtf8() and toUtf8() munges it too > much, what happens if you simplify, instead of: > > QString jpgBufferString( finalJpg.data() ); > QString encodedString = jpgBufferString.toUtf8().toBase64(); > > try: > QString encodedString = finalJpg.data().toBase64(); Hi,

Re: [Interest] displaying Qt-coded JPEG image in browser

2024-01-26 Thread Henry Skoglund
On 2024-01-26 13:55, Alexander Carôt via Interest wrote: Hi all, I have a raw image: QImage *img = new QImage(imgBufferOut, reso.width(), reso.height(), QImage::Format_RGB888); that I convert to JPG via QBuffer bu

[Interest] displaying Qt-coded JPEG image in browser

2024-01-26 Thread Alexander Carôt via Interest
Hi all, I have a raw image: QImage *img = new QImage(imgBufferOut, reso.width(), reso.height(), QImage::Format_RGB888); that I convert to JPG via QBuffer bufferJpeg; bufferJpeg.open(QIODevice::WriteOnly); img->save(&bu