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

Exception while rendering output of dewarp #30

Open cmahnke opened 1 year ago

cmahnke commented 1 year ago

This shouldn't happen, since I now can't work wich my project anymore, since switching to Output mode triggers this

Qt Concurrent has caught an exception thrown from a worker thread.
This is not supported, exceptions thrown in worker threads must be
caught before control returns to Qt Concurrent.
libc++abi: terminating with uncaught exception of type std::invalid_argument: fillMarginsInPlace: the content area exceeds image rect.
Abort trap: 6

Edit: Deleting the Section below makes the Project editable again:

Open the project file, look for the file name, get it's id, look it up in the image section take the page id there and look um the page. Usually the page id is the image id + 2. Anyways this is really annoying... There is a reference to the issue in another forum [as well](https://diybookscanner.org/forum/viewtopic.php?t=3673), but no solution. The source for the problem is [here](https://github.com/4lex4/scantailor-advanced/blob/3d1e74e6ace413733511086934a66f4e3f7a6027/src/core/filters/output/OutputGenerator.cpp#L527).
ghost commented 1 year ago

@cmahnke Are you on macOS?

cmahnke commented 1 year ago

@lightsilverberryfox: Yes, version 13.2.1.

ghost commented 1 year ago

Okay, I have never seen this issue, so, it could be platform specific.

darnn commented 1 year ago

I've had this happen on Windows, for the record, although not since I've started using the builds from here. However, I don't ever really use dewarp, so that might be what accounts for it, rather than it being fixed. IIRC it had to do with a situation where the dewarped image was significantly wider than the original selected area. At least that's how I experienced it.

ghost commented 1 year ago

I also have an exception thrown at some dewarped pages.

Qt Concurrent has caught an exception thrown from a worker thread.
This is not supported, exceptions thrown in worker threads must be
caught before control returns to Qt Concurrent.
terminate called after throwing an instance of 'std::invalid_argument'
  what():  fillMarginsInPlace: the content area exceeds image rect.

The system is Linux, Qt is 6

    libQt6Network.so.6 => /usr/lib64/libQt6Network.so.6 (0x00007f8b5503d000)
    libQt6Svg.so.6 => /usr/lib64/libQt6Svg.so.6 (0x00007f8b54fe4000)
    libQt6OpenGLWidgets.so.6 => /usr/lib64/libQt6OpenGLWidgets.so.6 (0x00007f8b54fd4000)
    libQt6Widgets.so.6 => /usr/lib64/libQt6Widgets.so.6 (0x00007f8b548bb000)
    libQt6OpenGL.so.6 => /usr/lib64/libQt6OpenGL.so.6 (0x00007f8b5481a000)
    libQt6Gui.so.6 => /usr/lib64/libQt6Gui.so.6 (0x00007f8b53f42000)
    libQt6Xml.so.6 => /usr/lib64/libQt6Xml.so.6 (0x00007f8b53eb7000)
    libQt6Core.so.6 => /usr/lib64/libQt6Core.so.6 (0x00007f8b5392a000)
    libQt6DBus.so.6 => /usr/lib64/libQt6DBus.so.6 (0x00007f8b52e25000)
kugland commented 1 year ago

This happens when you use dewraping with a page that is deskewed and has part of its content box outside the page, like in this the example:

image