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>
diff --git a/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx
index d4fdeea..72f12ca 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 672ef92..1a7e48d 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;
}