gimp/app/xcf
Ell e7d781ff0e app: future-proof XCF layer blend/composite props
The layer blend space, composite space, and composite mode
properties have a special AUTO value, which may map to different
concrete values based on the layer mode.  Make sure we can change
this mapping in the future, without affecting existing XCFs (saved
after this commit), by encoding these properties as follows:

When saving an XCF, if the property has a concrete (non-AUTO)
value, which is always positive, encode it as is.  If the property
is AUTO, which is always 0, encode it as the negative of the value
it actually maps to at the time of saving (note that in some cases
AUTO may map to AUTO, in which case it's encoded as 0).

When loading an XCF, if the encoded property (stored in the file)
is nonnegative, use it as is.  Otherwise, compare the negative of
the encoded property to the value AUTO maps to at the time of
loading.  If the values are equal, set the property to AUTO;
otherwise, use the concrete value (i.e., the negative of the value
stored in the XCF).

Note that XCFs saved prior to this commit still load fine, it's
simply that if we change the AUTO mapping in the future, all their
AUTO properties will keep being loaded as AUTO, even if the
resulting concrete values will have changed.
2017-05-21 08:44:19 -04:00
..
.gitignore Added .gitignore files generated with git svn create-ignore. 2009-01-31 11:37:44 +00:00
Makefile.am */Makefile.am: merge INCLUDES into AM_CPPFLAGS 2013-06-05 20:48:37 +02:00
xcf-load.c app: future-proof XCF layer blend/composite props 2017-05-21 08:44:19 -04:00
xcf-load.h Change licence to GPLv3 (and to LGPLv3 for libgimp). 2009-01-17 22:28:01 +00:00
xcf-private.h app: add new XCF property PROP_FLOAT_COLOR 2017-03-24 22:35:57 +01:00
xcf-read.c Bug 731390 - XCF files have a max size of 4G 2017-03-23 13:16:13 +01:00
xcf-read.h Bug 731390 - XCF files have a max size of 4G 2017-03-23 12:26:09 +01:00
xcf-save.c app: future-proof XCF layer blend/composite props 2017-05-21 08:44:19 -04:00
xcf-save.h app: move the XCF version logic to gimpimage.[ch] 2014-09-27 20:38:43 +02:00
xcf-seek.c Bug 731390 - XCF files have a max size of 4G 2017-03-23 11:44:41 +01:00
xcf-seek.h Bug 731390 - XCF files have a max size of 4G 2017-03-23 11:44:41 +01:00
xcf-write.c Bug 731390 - XCF files have a max size of 4G 2017-03-23 13:16:13 +01:00
xcf-write.h Bug 731390 - XCF files have a max size of 4G 2017-03-23 12:42:38 +01:00
xcf.c app, libgimp: allow to register more than one MIME type per procedure 2017-05-04 23:22:37 +02:00
xcf.h app: factor out xcf_load_stream() and xcf_save_stream() 2016-09-18 20:19:42 +02:00