It is currently Tue Jul 02, 2024 6:43 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: plugin compatibility Gimp 2.9: downward compatible?
PostPosted: Fri Nov 04, 2016 2:20 am  (#1) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
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. ????


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: plugin compatibility Gimp 2.9: downward compatible?
PostPosted: Fri Nov 04, 2016 5:47 am  (#2) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2436
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 2922 times ]


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

_________________
Image


Top
 Post subject: Re: plugin compatibility Gimp 2.9: downward compatible?
PostPosted: Fri Nov 04, 2016 6:31 am  (#3) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
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 :(


Top
 Post subject: Re: plugin compatibility Gimp 2.9: downward compatible?
PostPosted: Fri Nov 04, 2016 7:58 am  (#4) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
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


Top
 Post subject: Re: plugin compatibility Gimp 2.9: downward compatible?
PostPosted: Fri Nov 04, 2016 8:01 am  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4752
Test the gimp.version variable and set a PATTERN_FILL variable to FILL_PATTERN if >= (2,9,0)

_________________
Image


Top
 Post subject: Re: plugin compatibility Gimp 2.9: downward compatible?
PostPosted: Fri Nov 04, 2016 8:06 am  (#6) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
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?)


Top
 Post subject: Re: plugin compatibility Gimp 2.9: downward compatible?
PostPosted: Fri Nov 04, 2016 9:03 am  (#7) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
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 .


Top
 Post subject: Re: plugin compatibility Gimp 2.9: downward compatible?
PostPosted: Fri Nov 04, 2016 11:32 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
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)

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: plugin compatibility Gimp 2.9: downward compatible?
PostPosted: Fri Nov 04, 2016 12:13 pm  (#9) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2436
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 2856 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.

_________________
Image


Top
 Post subject: Re: plugin compatibility Gimp 2.9: downward compatible?
PostPosted: Fri Nov 04, 2016 1:27 pm  (#10) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4752
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.

_________________
Image


Top
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Commands to make scripts fwd & bwd compatible

10

No new posts Attachment(s) Baby's first GEGL plugin - a very basic GEGL plugin anyone can make.

9

No new posts Can't get plugin to appear (mostly)

3

No new posts Attachment(s) Help! What's the plugin called?

7

No new posts Attachment(s) Plugin superxBR

7



* Login  



Powered by phpBB3 © phpBB Group