Repository navigation
Add additive 64-bit TIFF input API - #197
Conversation
|
Just testing approaches and ideas |
5e8c22e to
0d5f5e8
Compare
|
The new public entry points in this PR are:
These APIs are available on Windows, Linux and macOS, and are not restricted to 64-bit processes. The final CI passes Linux x86 and Windows MinGW32 static/DLL tests, as well as the native 64-bit builds. The tests exercise TIFF positions beyond both 2 GiB and 4 GiB. No additional user-facing “64-bit” define or CMake option is required to enable these APIs. Their offset types are explicitly For custom callbacks, the application's implementation must also support wide file positions. On 32-bit POSIX, that normally means compiling that callback code with Current scope is single-image TIFF/BigTIFF input only. Other formats return |
|
Okay looking to merge this any comments @thbeu @haobinnan |
10129ae to
6c964f3
Compare
I already replied here |
I think this can be merged. |
6c964f3 to
122dfd2
Compare
|
The one unexpected failure was a GitHub release-asset HTTP 500 during download, before the decoder ran. All valid large-file TIFF fixtures passed, including files with offsets above 4 GiB. Updated results below are from the successful run 40698598326, commit
What the 64-bit test actually checks: TIFF fixtures already use Do we need a passing 64-bit test? Those positive tests are already present: classic TIFF strips above 2 GiB and just below 4 GiB; BigTIFF strips/IFDs above 4 GiB; both byte orders; and Exif/thumbnails above 4 GiB. They pass on all four platforms, even a 32-bit Windows process using 64-bit file offsets. Why the four XFAIL cases remain: their intended outcome is rejection. Three malformed TIFFs are already being tested through the 64-bit API; wider offsets do not repair absent/truncated pixel data. The BMP case uses the existing BMP API. These are recorded acceptance bugs, not valid large images that should start decoding after widening offsets. A future loader fix should make the original rejection assertions pass; changing the expectation to successful decoding would hide the bugs. Fix pushed: 65feb7c retries transient HTTP/network errors up to four attempts (1, 2, 4 second delays). Persistent errors, hash mismatches, oversized responses and decoder failures still fail. All 23 packaging/runner tests pass locally, including a simulated HTTP 500 followed by a successful download; that recovery regression fails against the pre-fix runner. Cross-platform verification passed on all four platforms. The 23 runner tests and LargeFileTIFFTest also passed on all four platforms. PASS means the expected outcome occurred: valid input decoded correctly, or malformed input was rejected. XFAIL means the malformed input incorrectly returned a bitmap and is explicitly recorded in the pinned manifest. HTTP 500 means the decoder was never reached. All 91 images: expected result, per-platform result and explanation
|
Add a 64-bit TIFF/BigTIFF input path so small images can be decoded when their directories, metadata, thumbnails or pixel strips lie beyond 2 GiB or 4 GiB, including on Windows where
longremains 32-bit.FreeImageIO64,FreeImage_Load64andFreeImage_LoadFromHandle64are additive APIs. ExistingFreeImageIO, load signatures and the externalPlugindescriptor retain their layouts and ABI. TIFF dispatch stays private. The new path supports read-only custom streams, checks callbacks and transfers, propagates I/O failures and respects disabled plugins. Default file callbacks use_fseeki64/_ftelli64on Windows and wide POSIX file offsets.Scope is single-image TIFF input. Other formats return
NULLthrough the new APIs; saving, multipage, Unicode filename entry points and the DWORD-sized memory API are outside this change. PNG/BMP release fixtures exercise their existing loaders.The
Published large-file image testsworkflow downloads the 91 individual payloads from test-fixtures-io64-v1, pins the manifest SHA-256, and verifies each payload before extraction. It tests and removes one image at a time, including after failure/timeout. Coverage includes filename/custom-stream loading, native pixels, high-offset Exif/thumbnails, header-only TIFF loading, malformed data, and nested multilingual paths. Windows opens UTF-16 paths through the custom-stream API. The matrix covers Linux ASan, macOS C++11, MSVC x64 DLL and MSVC Win32.Four malformed strip/offset fixtures are known to return a bitmap instead of being rejected on the earlier #197 baseline. They are explicitly reported as
XFAILwhen the decoder returns the dedicated status and the pinned manifest declares the known behavior. Other failures block CI; successful rejection passes normally. These failures remain visible rather than being counted as passing rejection tests.Validation on master
9a22df4(fixture PR #233 merged):git range-diff).Published-fixture CI passes on all four platforms: Linux ASan, macOS C++11, MSVC x64 DLL and MSVC Win32. Both native Windows runs report 87 passed, 4 documented known failures and 0 unexpected failures. CMake supplies the decoder executable path so per-target Windows output directories are handled correctly.