GIMP Chat
http://gimpchat.com/

plugin compatibility Gimp 2.9: downward compatible?
http://gimpchat.com/viewtopic.php?f=9&t=14857
Page 1 of 1

Author:  PKHG [ Fri Nov 04, 2016 2:20 am ]
Post subject:  plugin compatibility Gimp 2.9: downward compatible?

PythonFu Plugin-writers
How to solve downward compatibility 2.9 (or higher) to 2.8?

Reasons:
1. Name Changes example:
         pdb.gimp_edit_fill(fill_layer,PATTERN_FILL)    #GIMP 2.8
         #pdb.gimp_edit_fill(fill_layer,FILL_PATTERN)     #GIMP 2.9

Thanks to MQ.

If one (WE!) use this way of notifying needed changes, one could eventually give a notice of how to change a file to a version one needs.
From 2.8 to 2.9:
E.g. in Emacs: Search for #GIMP 2.8, go to beginning of line, insert a # (suitable place), goto start of next line, remove the next first #

Make it a macro and execute as often as needed.

This could naturally wrapped into a Python action file. Emacs commands 'translated' to Python commands.

2. New features in >2.8
Not solvable???

3. ????

Author:  rich2005 [ Fri Nov 04, 2016 5:47 am ]
Post subject:  Re: plugin compatibility Gimp 2.9: downward compatible?

Plenty of the most used plugins, in theory should be re-written even for Gimp 2.8

example heal-selection

run Gimp with compatibility off

gimp --pdb-compat-mode=off


and you get an error even in Gimp 2.8. Development 2.9 versions certainly.

Attachment:
deprecated.jpg
deprecated.jpg [ 54.87 KiB | Viewed 2930 times ]


I suspect that even Gimp 2.10 when it arrives will come with compatibility=on.

Author:  PKHG [ Fri Nov 04, 2016 6:31 am ]
Post subject:  Re: plugin compatibility Gimp 2.9: downward compatible?

I do not ask for lower than 2.8 (18), that would probably too much work for a normal Gimp user with some knowledge about plugins :(

Author:  paynekj [ Fri Nov 04, 2016 7:58 am ]
Post subject:  Re: plugin compatibility Gimp 2.9: downward compatible?

I think you might be a bit premature writing code to support 2.9 yet, as it's still fundamentally very changeable.
For example from this week:
https://git.gnome.org/browse/gimp/commit/?id=3307c719663dd3aefb5722ad5cdb7faf03bcfdaf
Where the ranges into the new histogram/threshold tools will change from 0->255 into 0.0->1.0

Kevin

Author:  ofnuts [ Fri Nov 04, 2016 8:01 am ]
Post subject:  Re: plugin compatibility Gimp 2.9: downward compatible?

Test the gimp.version variable and set a PATTERN_FILL variable to FILL_PATTERN if >= (2,9,0)

Author:  paynekj [ Fri Nov 04, 2016 8:06 am ]
Post subject:  Re: plugin compatibility Gimp 2.9: downward compatible?

ofnuts wrote:
Test the gimp.version variable and set a PATTERN_FILL variable to FILL_PATTERN if >= (2,9,0)


But then what to do for other changes that happen at some indeterminate point in 2.9.5 at commit xxxxx given that the commit identifiers aren't sequentially incrementing values? (and are they accessible from the scheme/Python APIs?)

Author:  PKHG [ Fri Nov 04, 2016 9:03 am ]
Post subject:  Re: plugin compatibility Gimp 2.9: downward compatible?

paynekj, why so pessimistic???

If someone has a plugin wanting to use in 2.9 version but it does not work, does work in 2.8, and if it is ONLY a small change to get it working, see ofnuts comment ...
THAT is reason to start something special for those problems here .

Author:  MareroQ [ Fri Nov 04, 2016 11:32 am ]
Post subject:  Re: plugin compatibility Gimp 2.9: downward compatible?

Hi Ofnuts.

Can you put the code on how to properly use "Test the gimp.version" for example, Your plugin:
path-grid-0.1.py
https://sourceforge.net/projects/gimp-path-tools/files/scripts/


In GIMP 2.9.5:
called deprecated procedure 'gimp-image-add-vectors'.It should call 'gimp-image-insert-vectors' instead!

In line 64 and 100 changed
from:
pdb.gimp_image_add_vectors(self.image, self.path, 0)

to:
pdb.gimp_image_insert_vectors(self.image, self.path, None, 0)

Author:  rich2005 [ Fri Nov 04, 2016 12:13 pm ]
Post subject:  Re: plugin compatibility Gimp 2.9: downward compatible?

Hi MareroQ

I think PKHG missed the point of the post about compatibility.

Yes, Gimp 2.9.5 will fail on many scripts and plugins due to changes in the python syntax

but

Run (or compile) gimp 2.9 with compatibility mode ON "--pdb-compat-mode=on"

Attachment:
gimp29.jpg
gimp29.jpg [ 176.46 KiB | Viewed 2864 times ]


Should they be re-writtten if possible, of course they should. In the meantime Gimp 2.9.5 is a great tool and really fun to use.

Author:  ofnuts [ Fri Nov 04, 2016 1:27 pm ]
Post subject:  Re: plugin compatibility Gimp 2.9: downward compatible?

MareroQ wrote:
Hi Ofnuts.

Can you put the code on how to properly use "Test the gimp.version" for example, Your plugin:
path-grid-0.1.py
https://sourceforge.net/projects/gimp-path-tools/files/scripts/


In GIMP 2.9.5:
called deprecated procedure 'gimp-image-add-vectors'.It should call 'gimp-image-insert-vectors' instead!

In line 64 and 100 changed
from:
pdb.gimp_image_add_vectors(self.image, self.path, 0)

to:
pdb.gimp_image_insert_vectors(self.image, self.path, None, 0)


In python you can compare tuples:
if gimp.version >= (2,9,0):


Calling a deprecated procedure is not an error. The odd-numbered versions emit a warning but do not stop, just use a console dialog to not get stopped by the messages. I won't change my distributed code until 2.10 is out, since there are still 2.6 users around (because the deprecated thing above is deprecated is 2.8 too, you had the same messages in 2.7...).

If you change my code and redistribute it, make it clear that it is your code and that you assume the maintenance of the fork.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/