Author Topic: Script dimensions error  (Read 2928 times)

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Script dimensions error
« on: 2012 March 24 14:29:37 »
I am seeing an unexpected dimensions error, see attached png.

The script attempts to make a copy of the source view. If the script is executed via the Script Editor's Execute -> Compile & Run command, the script completes successfully.

On the other hand, if the script is executing by dragging a process icon onto the source view, the dimensions error occurs. This latter behavior appears to be a bug.

Here is how to reproduce the problem:

(Note: we are going to run the script and show that it works correctly.)
Open the image //pixinsight.com/examples/M57-CAHA/M57_CAHA_RECTA_DSA.jpg.
Create a preview of a part of this image (for example, a subregion containing the nebula).
Activate the preview by clicking its View Selector.
Choose the command Image -> Color Spaces -> Convert to Grayscale.
(Note: at this point the main view remains RGB, only the preview is Grayscale, also the preview remains the active view).
Open the attached script in the Script Editor, choose the Execute -> Compile & Run command.
(Note: at this point a script generates a new image window, a copy of the preview, successfully).
Close this new image window.

(Note: Now we are going to create a process icon and drag it to the preview and reproduce the error.)
Choose the command Process -> <All Processes> -> Script.
In the Script dialog, set File Path to the file name of the attached script.
In the Script dialog, clear the MD5 field.
Drag the New Instance icon in the Script dialog to the workspace.
Close the Script dialog.

(Note: Verify that the preview is active, and verify that it is Grayscale.)
Drag the icon to the preview.
The attached error dialog is displayed.

(Note: at this point the preview has been changed from Grayscale to RGB. If you want to rerun the above procedures, please make sure to convert the preview to Grayscale first before proceeding.)

Note that the script does not change the dimensions of the source view nor its main view in any way. Apparently the unequal color spaces of the main view and preview and process icon execution are not compatible in some way.

Version 01.07.05.0779 Starbuck (eng x86_64).

Thanks,
Mike



« Last Edit: 2012 March 24 14:45:58 by mschuster »

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Script dimensions error
« Reply #1 on: 2012 April 02 08:39:46 »
Hi Mike,

Interesting. We have two items here:

* When you execute the Script instance, the preview is restored to its previous nonvolatile state prior to execution. This is the expected behavior; previews always work this way in PixInsight. In this case, the only nonvolatile state is the initial one, that is when the preview was just created and hence was an RGB image, as its mother image. If you don't want this to happen, store the preview's state to turn it into nonvolatile (Preview > Store) before executing the Script instance.

* The error message is obviously a bug. In first place, Script is one of the two internal processes in PixInsight (the other one is ProcessContainer), so telling the user that it might be uninstalled is funny. On the other hand, there is no 'betrayal' of the Script process here because the target view is a preview, so it is perfectly normal that its state be restored to nonvolatile when a process is executed. So the error message is fake. I'll fix this bug in the next version.

I'm glad with this kind of in-depth examination of PixInsight's internal logic. Thanks and keep them coming!
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Script dimensions error
« Reply #2 on: 2012 April 02 08:59:34 »
In the annotation script when applied on an image (instead of the global context) I modify the target image instead creating a new one. This allows to use the script in an ImageContainer.
The problem is that for grayscale images I have to convert them to RGB to keep the colors in the annotation. However if I do this, the ugly "Script dimensions error" message appears. For now, I don't convert the image to RGB when the script is applied to a view, but this loses the colors of the annotation.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Script dimensions error
« Reply #3 on: 2012 April 03 08:55:45 »
Hi,

This bug is now completely fixed in version 1.7.6.793 of the core application. We are preparing the release of this version right now.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/