If such large images are in common use, it would also be worth looking at not reading the whole file into memory (like it was back in 0.7), this is tracked in issue #8.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The code in git master now supports larger files on 64-bit environments, where file offsets and lseek() are 64 bit. It may work on 32-bit if compiling with _FILE_OFFSET_BITS == 64 on GCC. I'll leave this ticket open until this has been confirmed, and we figure out how to best include this by default where it makes sense.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The lseek64/etc part in the original request has been solved. The problem remains that we are making one memory allocation for the whole file. This would be solved by issue #8 but I am keeping this ticket open since there could be other ways.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A patch would be welcome :)
If such large images are in common use, it would also be worth looking at not reading the whole file into memory (like it was back in 0.7), this is tracked in issue #8.
The code in git master now supports larger files on 64-bit environments, where file offsets and lseek() are 64 bit. It may work on 32-bit if compiling with
_FILE_OFFSET_BITS == 64on GCC. I'll leave this ticket open until this has been confirmed, and we figure out how to best include this by default where it makes sense.Maybe simply AC_SYS_LARGEFILE in configure.ac
When building 64-bit binaries with MingW, there is still the 2GB limitation.
Just adding AC_SYS_LARGEFILE doesn't change CFLAGS by itself. This does, although it doesn't look pretty IMO:
I sure must be missing something.
EDIT: Indeed AC_SYS_LARGEFILE is enough. The problem was that config.h (where the correct defines end up) was included after stdio.h and not before.
FWIW, it seems that with MinGW _FILE_OFFSET_BITS gets defined both for 32-bit (i686-w64-mingw32) and 64-bit (x86_64-w64-mingw32).
EDIT: A broken check in portable.h (the irony) made off_t 32 bit also on 64-bit MinGW.
Last edit: Tormod Volden 2020-10-21
The lseek64/etc part in the original request has been solved. The problem remains that we are making one memory allocation for the whole file. This would be solved by issue #8 but I am keeping this ticket open since there could be other ways.