diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-06-01 20:24:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-06-02 10:01:14 +0200 |
commit | 1577c0dc30ed3c9db361fb989e41a3e9d6c45dfa (patch) | |
tree | 71464acad465177587d2d3854f1313f71c000df5 /vcl | |
parent | 7a1d4b7d1db93ca1f541856a8d00d621d50e7bd6 (diff) |
tdf#149418 the expectation is on success the tiff stream pos is at EOF
which is what the old one did, so do that here as well, libtiff will
leave the stream some other pos by default, presumably the directory.
which explains the testTdf138818 mystery
Change-Id: I574700f81a21ee164d9911e05e2023aa48d10370
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135279
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx | 5 | ||||
-rw-r--r-- | vcl/source/filter/itiff/itiff.cxx | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx index d4fdeea43524..72f12ca565f5 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx @@ -113,7 +113,6 @@ void TiffFilterTest::testTdf115863() CPPUNIT_ASSERT_EQUAL(tools::Long(618), aSize.Height()); } -//TODO-check if this is still correct, looks ok, but what was it testing exactly void TiffFilterTest::testTdf138818() { OUString aURL = getUrl() + "tdf138818.tif"; @@ -126,9 +125,9 @@ void TiffFilterTest::testTdf138818() CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, bResult); // Without the fix in place, this test would have failed with - // - Expected: 45953 + // - Expected: 46428 // - Actual : 45951 - CPPUNIT_ASSERT_EQUAL(sal_uInt32(45953), aGraphic.GetGfxLink().GetDataSize()); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(46428), aGraphic.GetGfxLink().GetDataSize()); } void TiffFilterTest::testTdf74331() diff --git a/vcl/source/filter/itiff/itiff.cxx b/vcl/source/filter/itiff/itiff.cxx index 672ef92d902a..1a7e48d1a3e9 100644 --- a/vcl/source/filter/itiff/itiff.cxx +++ b/vcl/source/filter/itiff/itiff.cxx @@ -113,6 +113,8 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) if (!tif) return false; + const auto nOrigPos = rTIFF.Tell(); + Animation aAnimation; do @@ -246,9 +248,14 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) rGraphic = aAnimation.GetBitmapEx(); else rGraphic = aAnimation; + + // seek to end of TIFF if succeeded + rTIFF.Seek(STREAM_SEEK_TO_END); + return true; } + rTIFF.Seek(nOrigPos); return false; } |