Repository navigation
Conversation
FreeImage 3.19.29 adds FreeImage_Load64 and FreeImage_LoadFromHandle64 for single-image TIFF and BigTIFF input. ofImage uses that path when the included header is 3.19.29 or newer. Headers before that keep FreeImage_Load and FreeImage_LoadFromMemory. Memory buffers larger than the legacy int limit are not passed to FreeImage_OpenMemory. A TIFF signature is read through the 64-bit stream. On Windows, TIFF files stay on the UTF-16 path and use LoadFromHandle64, because the new API has no LoadU64.
danoli3
marked this pull request as draft
October 29, 2026 23:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ofLoadImageuses FreeImage's 64-bit TIFF input API when the FreeImage header included by the build is 3.19.29 or newer. The publicofImage/ofLoadImagesignatures are unchanged, and this pull request does not vendor a newlibFreeImage.FreeImage PR 197 adds an additive read API:
FreeImageIO64FreeImage_Load64FreeImage_LoadFromHandle64That API reads one TIFF or BigTIFF, including images whose directories or strips sit past 2 GiB. Other formats return null from those entry points. Saving, multipage TIFF, and
FreeImage_OpenMemory(still aDWORDstored asint) are outside that change. There is noFreeImage_LoadU64.3.19.29 is not released yet. The header on PR 197 is still
FREEIMAGE_RELEASE_SERIAL28, so a build against that branch keeps the existing loader. The wide path turns on when a shipped header reports 3.19.29 or newer:The openFrameworks libraries published today include FreeImage 3.19.21, so current builds keep
FreeImage_Load/FreeImage_LoadFromMemory.Behavior
FreeImage_Load64. On Windows the path stays UTF-16: the file is opened with_wfopenand read throughFreeImage_LoadFromHandle64using_fseeki64/_ftelli64.II+/MM+), is loaded throughFreeImage_LoadFromHandle64.numeric_limits<int>::max()is not given toFreeImage_OpenMemory. A TIFF signature takes the 64-bit stream. Any other format logs an error and returns false.FreeImage_Load/FreeImage_LoadU/FreeImage_LoadFromMemory.Test
Syntax-only compile of
ofImage.cpp(C++17, macOS headers):OF_FREEIMAGE_IO64is 0 and the file compiles.FreeImage_Load64is not referenced.FREEIMAGE_RELEASE_SERIALset to 29:OF_FREEIMAGE_IO64is 1 and the new TIFF calls type-check againstFreeImageIO64.A wide TIFF has not been decoded here. That needs a FreeImage 3.19.29 library, which is not published yet.