Fixed a bug on bytesperline for rgb images.
--- a/qjpeg/gui/QChain-image.cpp Wed Nov 14 14:57:33 2007 +0100
+++ b/qjpeg/gui/QChain-image.cpp Thu Nov 15 18:47:08 2007 +0100
@@ -45,7 +45,7 @@
delete out;
img = new QImagePtr((uchar *) rgb->data(), rgb->getWidth(),
- rgb->getHeight(), QImage::Format_RGB32);
+ rgb->getHeight(), rgb->getWidth()*4, QImage::Format_RGB32);
delete rgb;
} else if (out->getComponents() == 1)
{
@@ -53,7 +53,7 @@
delete out;
img = new QImagePtr((uchar *) gray->data(), gray->getWidth(),
- gray->getHeight(), QImage::Format_Indexed8);
+ gray->getHeight(), gray->getWidth(), QImage::Format_Indexed8);
img->setColorTable(getGrayscale());
delete gray;
} else
--- a/qjpeg/gui/QImagePtr.h Wed Nov 14 14:57:33 2007 +0100
+++ b/qjpeg/gui/QImagePtr.h Thu Nov 15 18:47:08 2007 +0100
@@ -3,10 +3,12 @@
class QImagePtr : public QImage
{
public:
- QImagePtr ( uchar * data, int width, int height, Format format )
- : QImage(data, width, height, width, format) {};
- QImagePtr ( const uchar * data, int width, int height, Format format )
- : QImage(data, width, height, width, format) {};
+ QImagePtr ( uchar * data, int width, int height, int bytesperline,
+ Format format )
+ : QImage(data, width, height, bytesperline, format) {};
+ QImagePtr ( const uchar * data, int width, int height, int bytesperline,
+ Format format )
+ : QImage(data, width, height, bytesperline, format) {};
~QImagePtr() {
delete[] bits();
};