diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-06-27 14:48:36 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-06-30 08:02:45 +0200 |
commit | 29dc1029be6d8d02f4b639b32274a286afd0b1b3 (patch) | |
tree | 0b49af8c7324ed9956f3366d6a09726e52ffc06a /vcl/qa/cppunit/jpeg/JpegWriterTest.cxx | |
parent | 63f3485b57904de4e77c04f5759e6563fcce6748 (diff) |
differentiate between 8bit and any-bit grey palette (tdf#121120)
Only the grey palette with 256 colors means that pixel values map
directly to color values. Tdf#121120 has an image with 2-bit
palette where color index 1 is (255,255,255), but that means
the pixel value 1 cannot be just treated as color.
Change-Id: Ifbd953af7f291e4fb8032ea0f4c33c0514770856
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97283
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/qa/cppunit/jpeg/JpegWriterTest.cxx')
-rw-r--r-- | vcl/qa/cppunit/jpeg/JpegWriterTest.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vcl/qa/cppunit/jpeg/JpegWriterTest.cxx b/vcl/qa/cppunit/jpeg/JpegWriterTest.cxx index fc06256c5f86..b4d9d24603eb 100644 --- a/vcl/qa/cppunit/jpeg/JpegWriterTest.cxx +++ b/vcl/qa/cppunit/jpeg/JpegWriterTest.cxx @@ -71,7 +71,7 @@ void JpegWriterTest::testWrite8BitGrayscale() const ScanlineFormat format = access->GetScanlineFormat(); // Check that it's still 8bit grayscale. CPPUNIT_ASSERT_EQUAL(ScanlineFormat::N8BitPal, format); - CPPUNIT_ASSERT(bitmap.HasGreyPalette()); + CPPUNIT_ASSERT(bitmap.HasGreyPalette8Bit()); // Check that the content is valid. CPPUNIT_ASSERT_EQUAL(BitmapColor(COL_WHITE), access->GetColor(0, 0)); CPPUNIT_ASSERT_EQUAL(BitmapColor(COL_WHITE), access->GetColor(0, access->Width() - 1)); @@ -87,10 +87,11 @@ void JpegWriterTest::testWrite8BitNonGrayscale() const ScanlineFormat format = access->GetScanlineFormat(); // Check that it's still 8bit grayscale. CPPUNIT_ASSERT_EQUAL(ScanlineFormat::N8BitPal, format); - // The original image has grayscale palette, just with entries in a different order, - // so do not check for non-grayscale, the roundtrip apparently fixes that. What's important + // The original image has grayscale palette, just with entries in a different order. + // Do not check for grayscale 8bit, the roundtrip apparently fixes that. What's important // is the content. - // CPPUNIT_ASSERT(!bitmap.HasGreyPalette()); + CPPUNIT_ASSERT(bitmap.HasGreyPaletteAny()); + // CPPUNIT_ASSERT(bitmap.HasGreyPalette8Bit()); // Check that the content is valid. CPPUNIT_ASSERT_EQUAL(BitmapColor(COL_WHITE), access->GetColor(0, 0)); CPPUNIT_ASSERT_EQUAL(BitmapColor(COL_WHITE), access->GetColor(0, access->Width() - 1)); |