summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2022-05-17 21:04:51 +0200
committerJulien Nabet <serval2412@yahoo.fr>2022-05-17 21:05:28 +0200
commit522de4493e982d987f55fd88a64dd9e83c46e895 (patch)
tree66aced47a76c676d885da74f408603e3d83b71e9
parentf0d3727322207b3a547313e14305440ad7009079 (diff)
Revert "tdf#122057: read tiff with deflate compression (code 32946 only)"
This reverts commit f0d3727322207b3a547313e14305440ad7009079. Reason for revert: Gimp was displaying a black rectangle, thought it was ok. Then with just Firefox, I could see that it should display a design plan for a house. Change-Id: I3a87ba24e779aee74d2124bf985b66c9cd7a0bb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134449 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--vcl/Library_vcl.mk1
-rw-r--r--vcl/source/filter/itiff/itiff.cxx64
2 files changed, 1 insertions, 64 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 626134894bd0..a141e22348dd 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -69,7 +69,6 @@ $(eval $(call gb_Library_use_libraries,vcl,\
i18nutil \
$(if $(ENABLE_JAVA),jvmaccess) \
$(if $(filter OPENCL,$(BUILD_TYPE)),opencl) \
- package2 \
sal \
salhelper \
sot \
diff --git a/vcl/source/filter/itiff/itiff.cxx b/vcl/source/filter/itiff/itiff.cxx
index 894241a68d38..cff68f9e6ec9 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -20,10 +20,6 @@
#include <sal/config.h>
#include <sal/log.hxx>
-#include <comphelper/sequence.hxx>
-#include <optional>
-#include <package/Inflater.hxx>
-
#include <unotools/configmgr.hxx>
#include <vcl/FilterConfigItem.hxx>
#include <vcl/graph.hxx>
@@ -712,64 +708,6 @@ bool TIFFReader::ReadMap()
return false;
}
}
- else if ( nCompression == 32946 ) // deflate compression (legacy code)
- {
- sal_uInt32 nStrip(0);
- if (nStrip >= aStripOffsets.size())
- return false;
- pTIFF->Seek(aStripOffsets[nStrip]);
-
-
- sal_Int32 nRowSize = (static_cast<sal_uInt64>(nImageWidth) * nSamplesPerPixel / nPlanes * nBitsPerSample + 7) >> 3;
-
- for (sal_Int32 ny = 0; ny < nImageLength; ++ny)
- {
- for (sal_uInt32 np = 0; np < nPlanes; ++np)
- {
- if ( ny / GetRowsPerStrip() + np * nStripsPerPlane > nStrip )
- {
- nStrip = ny / GetRowsPerStrip() + np * nStripsPerPlane;
- if (nStrip >= aStripOffsets.size())
- return false;
- pTIFF->Seek(aStripOffsets[nStrip]);
- }
- if (np >= SAL_N_ELEMENTS(aMap))
- return false;
-
- // Inflater uses in and out sequences
- // 1) Preparation: read in nBytesPerRow from the stream, put it on the sequence and initialize decompresser with it
- css::uno::Sequence<sal_Int8> aInput(nBytesPerRow);
- sal_uInt8* aInputArray = reinterpret_cast< sal_uInt8* >( aInput.getArray( ) );
- for (size_t i = 0; i < nBytesPerRow ; ++i)
- {
- pTIFF->ReadUChar(aInputArray[i]);
- }
- std::optional< ::ZipUtils::Inflater> decompresser(std::in_place, false);
- decompresser->setInput(aInput);
-
- // 2) Decompression
- css::uno::Sequence<sal_Int8> aOutput(nRowSize);
- decompresser->doInflateSegment(aOutput, 0, nRowSize);
- decompresser->end();
- decompresser.reset();
-
- // 3) Result retrieving: put the read row in the aMap which will be read by ConvertScanline later
- auto pDest = getMapData(np);
- for (sal_Int32 i = 0; i < nRowSize; ++i)
- *pDest++ = aInput[i];
-
- if ( pTIFF->GetError() )
- return false;
- }
-
- nTotalDataRead += nBytesPerRow;
- if (nMaxAllowedDecompression && nTotalDataRead > nMaxAllowedDecompression)
- return false;
-
- if ( !ConvertScanline( ny ) )
- return false;
- }
- }
else if ( nCompression == 32773 )
{
sal_uInt32 nStrip(0);
@@ -1646,7 +1584,7 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
bStatus = false;
}
}
- else if (nCompression == 5 || nCompression == 32946)
+ else if (nCompression == 5)
{
sal_uInt32 np = nPlanes - 1;
if (np >= SAL_N_ELEMENTS(aMap))