Resolved crash in Scantailor 0.9.11.1 (Ubuntu 11.10 amd64)

Scan Tailor specific announcements, releases, workflows, tips, etc. NO FEATURE REQUESTS IN THIS FORUM, please.

Moderator: peterZ

Post Reply
Mangan
Posts: 17
Joined: 19 Jan 2012, 14:33
E-book readers owned: Sony Xperia Arc
Number of books owned: 1000

Resolved crash in Scantailor 0.9.11.1 (Ubuntu 11.10 amd64)

Post by Mangan »

I had a crash when generating out from the above mentioned version of ScanTailor. At first, I aimlessly changed the content box on the page it crashed and i helped. Then, that didn't help so I decide to try debugging.
Compiled with Debug, and run through gdb. Assert failure in the OutputGenerator constructor, line 253

I'm very c++-rusty, so crude printing of the coordinates for m_outRect and _contentRect showed that contentRect when it crashed was one more than outRect. Looked a couple of lines above, and saw the creation of these members came from resultingRect() and boundingRect(). Immediately suspected rounding errors and changed the ".toRect()" on lines 247 and 248 to ".toAlignedRect()".

Voila, Works For Me!

Perhaps one should do a more thorough analysis than my stabs in the dark before committing to code... ;)
Tulon
Posts: 687
Joined: 03 Oct 2009, 06:13
Number of books owned: 0
Location: London, UK
Contact:

Re: Resolved crash in Scantailor 0.9.11.1 (Ubuntu 11.10 amd6

Post by Tulon »

I've seen this kind of crash once or twice before - not personally, but from reports. Unfortunately, it's not easy to reproduce. Can you zip up your project file and a single source image on which it crashes, upload to depositfiles.com or similar site and post a link here?
Scan Tailor experimental doesn't output 96 DPI images. It's just what your software shows when DPI information is missing. Usually what you get is input DPI times the resolution enhancement factor.
Mangan
Posts: 17
Joined: 19 Jan 2012, 14:33
E-book readers owned: Sony Xperia Arc
Number of books owned: 1000

Re: Resolved crash in Scantailor 0.9.11.1 (Ubuntu 11.10 amd6

Post by Mangan »

I created a project with just one page (copied, so exact same settings for that page/image), but then it worked. I suspect that the output rectangle is related to all files in the project and their alignment to each other. If this is indeed a rounding error, the you have to have the entire project for it to show up, right?

Perhaps it would be possible to evaluate the fix, and see if it fixes other crashes too? What is does is that i rounds the rectangle to the nearest larger integer.

I tried and managed to cut it down to 11 pages in the project before it started working again...
Tulon
Posts: 687
Joined: 03 Oct 2009, 06:13
Number of books owned: 0
Location: London, UK
Contact:

Re: Resolved crash in Scantailor 0.9.11.1 (Ubuntu 11.10 amd6

Post by Tulon »

I tried to reproduce it on the project you PMed me, but failed to reproduce the crash.
Mangan wrote:Perhaps it would be possible to evaluate the fix, and see if it fixes other crashes too?
Before I apply a fix, I have to understand how and why the problem is happening. The easiest way to understand that is by reproducing the problem. Unfortunately, I've never been able to do that. I could try to dig into the issue and figure it out without reproducing it, but that requires much time, something I don't have right now.
Scan Tailor experimental doesn't output 96 DPI images. It's just what your software shows when DPI information is missing. Usually what you get is input DPI times the resolution enhancement factor.
Post Reply