Page 1 of 2

Linux: 100% CPU consumption when using Hugin

Posted: Fri Mar 25, 2016 7:41 am
by rmtk
I use Hugin to create panorama photos. But when Hugin is creating panorama to the photo folder opened in XnviewMP, XnviewMP always use all the CPU and freeze the system. The problem can be prevented by creating panoramas to another folder other than the one opend in XniewMP. Please investigate it.

Re: Linux: 100% CPU cosumption when using Hugin

Posted: Thu Mar 02, 2017 4:46 pm
by rmtk
any update on this bug?

Re: Linux: 100% CPU consumption when using Hugin

Posted: Thu Mar 02, 2017 9:13 pm
by helmut
Thank you for your bug report, rmtk. Does the freeze of XnView end once Hugin is finished? I suspect that Hugin creates temporary (image) files while creating the panorama image. These new (image) files might be detected by XnView and it will try to display these new files and create thumbnails. The files might be locked by Hugin which prevents XnView from reading.

Just guessing, here. Could you start the creation of a panorama image and observe the folder with Windows Explorer to see what's happening actually?

Re: Linux: 100% CPU consumption when using Hugin

Posted: Fri Mar 03, 2017 12:41 pm
by rmtk
Yes. Hugin creates large temp files (sometimes larger than 30MB) during panorama creation. And in most cases Xnview can not recover from freezing when panorama creation finished and temp files removed.

Re: Linux: 100% CPU consumption when using Hugin

Posted: Fri Mar 03, 2017 1:15 pm
by helmut
rmtk wrote:Yes. Hugin creates large temp files (sometimes larger than 30MB) during panorama creation. And in most cases Xnview can not recover from freezing when panorama creation finished and temp files removed.
O.k., I see. I've seen something similar on Windows when copying files from my digital camera to my computer using a slow USB connection: XnView identifies new files immediately and loads them over and over again to display their thumbnail even though the files are still incomplete and still copied. This does not make sense and even causes problems like yours.

I think XnView MP's behaviour regarding new files should be improved; but I'm not sure whether something can be done about it. Perhaps it would be a good idea if XnView would not read files that have just been saved/modified (e.g. by verifying sytem date with last modified time) but wait till they have an age of some few seconds.

Re: Linux: 100% CPU consumption when using Hugin

Posted: Fri Mar 03, 2017 9:14 pm
by helmut
In topic Conflict with photoshop the solution was the exclusion files with extension "tmp". Do the temporary files created by Hugin also have "tmp" extension?

@Pierre: It might be a good idea to exclude "tmp" file extension by default.

Re: Linux: 100% CPU consumption when using Hugin

Posted: Sat Mar 04, 2017 3:30 pm
by rmtk
But for Hugin the temp files are tiff images and obviously I can't exclude .tif in extension list.
I think there can be an option to disable automatic thumbnail generation of folders or only for files smaller than a specific size.

Re: Linux: 100% CPU consumption when using Hugin

Posted: Mon Mar 06, 2017 2:36 pm
by xnview
i know only when there is a change in the folder, not if file is written. I update thumbnails after 600ms

Re: Linux: 100% CPU consumption when using Hugin

Posted: Mon Mar 06, 2017 4:25 pm
by helmut
xnview wrote:i know only when there is a change in the folder, not if file is written. I update thumbnails after 600ms
Having a delay is a good idea but from what rmtk and I experienced this is not enough because after this delay the updates on that folder and containing files may be still not completed.

Suggestion: Smart update mechanism
Whenever a folder update is identified, XnView should...
a.) ...wait a short delay.
b.) ...read and update thumbnails of all files that have been added or changed and are older than <x> seconds.
c.) ...if there is any file in the folder younger than <x> seconds, start with a.), again.

This mechanism will prevent XnView from reading files that are still copied or written by an external program.

Related topic:
- 0.82b3: Crash while other app handle files

Re: Linux: 100% CPU consumption when using Hugin

Posted: Tue Mar 14, 2017 3:19 pm
by helmut
@Pierre: How do you proceed with this? Is a change in the read/update mechanism of XnView possible? Perhaps later?

Re: Linux: 100% CPU consumption when using Hugin

Posted: Mon Mar 27, 2017 1:36 pm
by xnview
helmut wrote:@Pierre: How do you proceed with this? Is a change in the read/update mechanism of XnView possible? Perhaps later?
I've checked, and i know only when a file was modified or added.

Re: Linux: 100% CPU consumption when using Hugin

Posted: Mon Mar 27, 2017 1:51 pm
by helmut
xnview wrote:I've checked, and i know only when a file was modified or added.
File modification date would be sufficient for the suggested file reading drafted above. Could you please have a look at my "Smart update mechanism" drafted above?

Re: Linux: 100% CPU consumption when using Hugin

Posted: Mon Mar 27, 2017 3:12 pm
by xnview
i've tried but modified date (no file date) is not changed during writing

Re: Linux: 100% CPU consumption when using Hugin

Posted: Mon Mar 27, 2017 3:15 pm
by helmut
xnview wrote:i've tried but modified date (no file date) is not changed during writing
What about file size? Or check file locking by trying to open the file for reading and writing?

Re: Linux: 100% CPU consumption when using Hugin

Posted: Mon Mar 27, 2017 11:55 pm
by xnview
i've tried but no success, i need to watch files modification in folder (currently not supported by QT)