diff options
Diffstat (limited to 'vcl/source/filter/jpeg/JpegWriter.cxx')
-rw-r--r-- | vcl/source/filter/jpeg/JpegWriter.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/source/filter/jpeg/JpegWriter.cxx b/vcl/source/filter/jpeg/JpegWriter.cxx index f6787145eabf..c7a476a84de6 100644 --- a/vcl/source/filter/jpeg/JpegWriter.cxx +++ b/vcl/source/filter/jpeg/JpegWriter.cxx @@ -223,7 +223,10 @@ bool JPEGWriter::Write( const Graphic& rGraphic ) if( mpExpWasGrey ) *mpExpWasGrey = mbGreys; - mbNative = ( mpReadAccess->GetScanlineFormat() == ScanlineFormat::N24BitTcRgb ); + if ( mbGreys ) + mbNative = ( mpReadAccess->GetScanlineFormat() == ScanlineFormat::N8BitPal ); + else + mbNative = ( mpReadAccess->GetScanlineFormat() == ScanlineFormat::N24BitTcRgb ); if( !mbNative ) mpBuffer = new sal_uInt8[ AlignedWidth4Bytes( mbGreys ? mpReadAccess->Width() * 8L : mpReadAccess->Width() * 24L ) ]; |