X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fjpeg%2Fjpegloader.cpp;h=45689cf65725a032b3020ed62d546be46db4b345;hb=917c43de100807f4397e36b66b1a748dbf44370e;hp=b5801568712ed47f78f1ede3230ce351b1ea0c17;hpb=eacf9fc4ab7a95d08414c0d94a46925dd1a987bd;p=libs%2Fgui.git diff --git a/source/graphics/jpeg/jpegloader.cpp b/source/graphics/jpeg/jpegloader.cpp index b580156..45689cf 100644 --- a/source/graphics/jpeg/jpegloader.cpp +++ b/source/graphics/jpeg/jpegloader.cpp @@ -116,10 +116,10 @@ bool JpegLoader::detect(const string &sig) static const char jpeg_sig[] = { '\xFF', '\xD8', '\xFF' }; if(sig.size()err_mgr.jmp)) throw bad_image_data(priv->err_mgr.message); @@ -132,15 +132,17 @@ void JpegLoader::load(Image::Data &data) data.height = priv->jpeg.output_height; data.stride = priv->jpeg.output_width*priv->jpeg.output_components; data.fmt = RGB; +} - data.data = new char[data.stride*data.height]; +void JpegLoader::load_pixels_(Image::Data &data) +{ JSAMPROW rows[8]; while(priv->jpeg.output_scanlinejpeg.output_scanline; unsigned count = min(y, 8U); for(unsigned i=0; i(data.data+(y-i-1)*data.stride); + rows[i] = reinterpret_cast(data.pixels+(y-i-1)*data.stride); jpeg_read_scanlines(&priv->jpeg, rows, count); }