Author Topic: Behavior of PropertyAttribute_Permanent  (Read 4763 times)

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Behavior of PropertyAttribute_Permanent
« on: 2015 June 29 11:24:43 »
This message is question to Juan:

If I save a image which has a property with the attribute "Permanent", when I reload it the attribute gets lost. I don't know if this is as designed or if it is a bug.

My problem is that I am using this attribute when storing the splines for distortion correction in ImageSolver. If I don't set this attribute when the user applies any process to the image after having solved it, the image loses the property that stores the distortion correction. Setting the attribute "Permanent" fixes this, however when I open a image which has a distortion correction the property "Permanent" is not set so I can not modify it because it loses the splines.
Using this attribute is a hack for making this work and the ideal solution would be having the properties integrated seamlessly in the undo/redo system.

Since I don't understand the behavior of the properties I don't know if this has a fix or if I have to think on another method for storing the distortion correction data.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Behavior of PropertyAttribute_Permanent
« Reply #1 on: 2015 July 06 00:36:08 »
Hi Andrés,

This problem is completely overcome in version 1.8.4, which we are going to release soon. Properties are now integrated with process histories, projects, and the undo/redo function, just as the rest of image data.

Property attributes work now exactly as advertised. If you want a property stored in process histories, you should not set the Volatile and Permanent attributes. The Permanent attribute is reserved for special properties that are associated with images independently on how the image data are processed (for example, the original author of the image, or information about data acquisition conditions), so you should not use it in your script. You have to set the Storable attribute to ensure that your properties will be stored in image files (when using formats able to store image properties).

Image properties are now correctly stored and managed in XISF files, including serialization of property attributes. The whole set of XISF image property types is now fully supported by the PixInsight core application.

You can use conditional compilation to detect the new version:


#iflt __PI_VERSION__ 01.08.04
... code to deal with poor integration of image properties ...
#else
... properties working normally in version >= 1.8.4
#endif

Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Behavior of PropertyAttribute_Permanent
« Reply #2 on: 2015 July 06 01:10:16 »
Thanks Juan,

I'll wait to version 1.8.4.