Author Topic: Invalid view update request: The image is already being processed.  (Read 2582 times)

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Hi Juan,

This is a reproducible process container error, iMac 10.11.6, PI 1195.

• Open any image.
• Apply Crop process to the image, with zero cropping values.
• Create a script process instance on the workspace, and apply it to the image. Script below.
• Using History Explorer, create a process container instance for these two applications.
• Apply this process container to a second image.

Error: Invalid view update request: The image is already being processed.

The error occurs on the script's call to beginProcess().

It appears that all scripts that attempt to update the target fail on beginProcess(). The Crop here is a placeholder, substitute any other process and the error remains.

Thanks,
Mike

Script, which does nothing other than the begin and end process calls:
Code: [Select]
Parameters.targetView.beginProcess();
Parameters.targetView.endProcess();

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Hi Mike,

I still have to revise the code involved in this, but looks like a simple concurrency issue. Other than the fact that it's internal to the core application, ProcessContainer is a regular process. When you apply it to an image, the views involved are locked immediately, so invoking View.beginProcess() from a script causes this problem because the JS runtime detects that the view is already being processed. With PCL-based code this does not happen because the view locking mechanism is more sophisticated.

Obviously, this side effect is not what one would expect, so I'll try to improve ProcessContainer execution to avoid it. For now, the workaround is to execute the required processes sequentially. To avoid having to run them by hand, you can write a simple script to execute them. Sorry for the inconvenience.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/