Skip to content
Permalink
Browse files Browse the repository at this point in the history
ofz#889 readjust jpeg import
Change-Id: I4e25db429b8dee9265ab2ad468c21cc34a50df6c
Reviewed-on: https://gerrit.libreoffice.org/35325
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
  • Loading branch information
Caolán McNamara committed Mar 17, 2017
1 parent 2f1045a commit 6e6e54f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vcl/source/filter/jpeg/jpegc.cxx
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down

1 comment on commit 6e6e54f

@caolanm
Copy link
Contributor

@caolanm caolanm commented on 6e6e54f May 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (17th March 2017 commit) fixes a problem introduced by ceb53ad on 15th March 2017

Please sign in to comment.