diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2022-05-12 13:35:22 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-05-16 10:39:56 +0200 |
commit | cc6e2d409328f8e4d06305dde47cdc794945b4d8 (patch) | |
tree | 2663d7937871923e2a63dd6432e4721969d8e076 /vcl/source | |
parent | 9501315fc7baa9b7b32834252375afc39379305b (diff) |
tdf#119686: fix tiff with 1 bit per pixel
On the 30 pixels width images, the 3 first bytes were ok,
that's why the 24 first pixels of each line was ok.
The pb was in the fourth byte, you must read each bit of this last byte
until reaching 30 pixels, so 6 bits (since width 30 corresponds to 3 * 8 + (8 - 2)).
Here LO always shifted this byte with the same value, so used the value of the first bit for the last 6 bits of the last byte.
=> just decrement the shift value at the end of each loop
With this patch initial, attachment of the bugtracker https://bugs.documentfoundation.org/attachment.cgi?id=144656
and the more complex one https://bugs.documentfoundation.org/attachment.cgi?id=144656 are ok
Change-Id: I17339c54d6822c724184f167fb3a25b240e06543
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134235
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134248
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/filter/itiff/itiff.cxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/vcl/source/filter/itiff/itiff.cxx b/vcl/source/filter/itiff/itiff.cxx index cad78f1b7d1f..5ce017dea9c7 100644 --- a/vcl/source/filter/itiff/itiff.cxx +++ b/vcl/source/filter/itiff/itiff.cxx @@ -1120,6 +1120,7 @@ bool TIFFReader::ConvertScanline(sal_Int32 nY) while ( nx < nImageWidth ) { SetPixel(nY, nx++, ( nByteVal >> nShift ) & 1); + --nShift; } } } |