ScanTailor-Advanced / scantailor-advanced

ScanTailor Advanced is the version that merges the features of the ScanTailor Featured and ScanTailor Enhanced versions, brings new ones and fixes.
GNU General Public License v3.0
204 stars 8 forks source link

Large-format jpeg and png files can't be loaded #20

Open mrelg opened 2 years ago

mrelg commented 2 years ago

Large-format jpeg and png files with sizes somewhere around 5800x5800 pixels and above can't be loaded! The exact boundary isn't fixed. Files in tiff format don't hit this limitation.

This is a problem for book scans in 1200x1200 resolution over 12cm / 4.7inches in height.

The limit should be at least x3 larger to cover most of the book sizes.

trufanov-nok commented 2 years ago

Could you provide a link to a sample image that reproduces the problem?

mrelg commented 2 years ago

https://user-images.githubusercontent.com/55596057/179404441-f8f06c28-b88f-47ea-85e2-a7edd25773cd.jpg https://user-images.githubusercontent.com/55596057/179404911-e165185d-15e3-435b-8a95-e6b0ea25b344.png

trufanov-nok commented 2 years ago

I've successfully loaded them on linux machine. Are you using a Win version? 32 or 64-bit?
Also what exactly is happening? Any error nessages? Crashes? The image isn't displayed in thumb list view?

mrelg commented 2 years ago

First to verify I'm using [ScanTailor-Advanced-1.0.18_III.x64.zip (May 09, 2022) I did not build my own executable. Yes, I'm using Windows 10 Pro Education, 21H2 build, 64-bit operating system. After creating a project, selecting a folder, selecting the file, and fixing the DPI that correctly recognizes the image dimensions, inside the main window blank white thumbnail is shown on the right, and instead of a full view of the image error is shown as in the picture. Other images of a different type (TIF) can be simultaneously loaded, shown, and edited without the program crashing. And which DPI option is chosen does not affect the outcome. image image

mrelg commented 2 years ago

I see you maintain scantailor-universal. Did you use your fork to load the images?

trufanov-nok commented 2 years ago

I tried both, but I tried original Advanced fork instead of this one. Could you reproduce the problem with latest official ST Advanced release?: https://github.com/4lex4/scantailor-advanced/releases
If not, I would suspect that this fork is built with too old libjpeg dll version.

mrelg commented 2 years ago

"2019.8.16 Early Access" is loading both of the files successfully. Can the problem be in the new libjpeg-62.dll and libpng16.dll ?

mrelg commented 2 years ago

I have tried swapping DLLs but to no avail. It complains about it and crashes.

trufanov-nok commented 2 years ago

dll swapping won't work. The sources must be recompilled with newer binaries.
@vigri could you try to build sources with libjpeg9 or something?

vigri commented 2 years ago

@trufanov-nok I'll help if I can. Regarding the instructions from @kunzjacq the version with Qt6 can be build with jpeg or libjpeg-turbo.

I can't remember right now if I used jpeg or libjpeg-turbo to compile the file. I'll be able to check that in 1-2 days. However, I assume that it was libjpeg-turbo.

So you think @trufanov-nok replacing jpeg-turbo with jpeg will fix the problem?

trufanov-nok commented 2 years ago

It doesn't matter which jpeg is used for Qt compillation, as ST doesn't use Qt's jpeg plugin at all (for sure in my fork) or .. at least not for loading input images. It loads jpeg image calling jpeg library directly. So it's important which jpeg library is used to build ScanTailor executable itself. The latest release of this fork used libjpeg v 6.2 while according to https://github.com/4lex4/scantailor-libs-build STA prefers jpeg-9x

For ex., last time I built STU with jpeg-9c and libpng-1.6.37 for Windows.

ghost commented 1 year ago

I can reproduce this issue on my Linux, the program is killed with SIGKILL, I'm trying to figure out why.

EDIT: My Linux computer runs out of RAM and the kernel just kills the process.

EDIT2: I managed to process both pages on Linux, I'll try seeing what happens with Windows.

HaaiSo commented 11 months ago

I also encountered this problem

lrrosa commented 7 months ago

I can confirm this problem still exists in version 1.0.19 win x64. Reducing the image dimensions fixes the problem.