diff options
Diffstat (limited to 'vcl/source/filter/jpeg/jpegc.cxx')
-rw-r--r-- | vcl/source/filter/jpeg/jpegc.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx index 8d9b1626022d..e73065e668f0 100644 --- a/vcl/source/filter/jpeg/jpegc.cxx +++ b/vcl/source/filter/jpeg/jpegc.cxx @@ -132,7 +132,7 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines, } } - jpeg_start_decompress( &cinfo ); + jpeg_calc_output_dimensions(&cinfo); long nWidth = cinfo.output_width; long nHeight = cinfo.output_height; @@ -161,7 +161,6 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines, J_COLOR_SPACE best_out_color_space = JCS_RGB; ScanlineFormat eScanlineFormat = ScanlineFormat::N24BitTcRgb; ScanlineFormat eFinalFormat = pAccess->GetScanlineFormat(); - if (eFinalFormat == ScanlineFormat::N32BitTcBgra) { best_out_color_space = JCS_EXT_BGRA; @@ -190,10 +189,12 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines, cinfo.out_color_space != JCS_GRAYSCALE && cinfo.out_color_space != best_out_color_space) { - SAL_WARN("vcl.filter", "jpg with unknown out color space, forcing to :" << best_out_color_space); + SAL_WARN("vcl.filter", "jpg with unknown out color space, forcing to :" << best_out_color_space << " gray "); cinfo.out_color_space = best_out_color_space; } + jpeg_start_decompress(&cinfo); + JSAMPLE* aRangeLimit = cinfo.sample_range_limit; std::vector<sal_uInt8> pScanLineBuffer(nWidth * (bGray ? 1 : nPixelSize)); |