Author Topic: Bug when cancelling ongoing process to a preview  (Read 5211 times)

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
Bug when cancelling ongoing process to a preview
« on: 2007 July 05 04:06:04 »
Hi there,

I've found a bug by which cancelling a running process on a preview causes the preview to end up in the wrong state.

This is how to reproduce it:
 - Open an image.
 - Take a preview of it.
 - Select the preview.
 - Apply a process to it, for instance, a CurvesTransform with a curve that changes the preview in an obvious manner. I inverted the image.
 - Undo the preview.
 - Apply another process to the preview. Better if it's one which will take more than 3 seconds to complete because we will need time to...
 - ... cancel this second process.

Observed behaviour:
Just after cancelling, my preview returned to the inverted state just as if I pressed "Redo preview" after undoing. Also noteworthy is the fact that the button "Undo/Redo preview" didn't change accordingly and it remained with the "Redo" icon and tooltip. Clicking it, the preview reverted to the original state and the button didn't change (so now the preview state and this button were coherent). Further Undo/Redo cycles work as expected.

Expected behaviour:
I didn't expect the image to change at all.
--
 David Serrano

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
Bug when cancelling ongoing process to a preview
« Reply #1 on: 2007 July 07 12:49:13 »
Update: the same happens if, instead of manually cancelling the second process, an error occurs.
--
 David Serrano

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Bug when cancelling ongoing process to a preview
« Reply #2 on: 2007 August 04 10:09:43 »
Yes, this is a bug.

Add one more to your personal account ;)

After some investigation (~8000 lines involved), the problem seems to be in the internal processing history structures of previews. I don't have it well identified though: the code is pretty complex and includes "regions" that were written a couple years ago, so this needs substantial work.

However, please note that this bug does not cause any structural corruption, and that the correct state of the preview is restored after an Undo/Redo Preview operation (you can verify this on the Processing History window). So this bug is a bit nasty, but it is harmless. I'll try to fix it completely in the next version.

Thank you for the bug hunting work ;)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/