RSS/Atom feed Twitter
Site is read-only, email is disabled

Using parasites in script-fu

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

15 of 15 messages available
Toggle history

Please log in to manage your subscriptions.

Using parasites in script-fu Rob Antonishen 29 Jan 22:11
  Using parasites in script-fu Rob Antonishen 29 Jan 23:02
   Using parasites in script-fu Michael Schumacher 29 Jan 23:16
    Using parasites in script-fu Rob Antonishen 30 Jan 00:25
   Using parasites in script-fu saulgoode@flashingtwelve.brickfilms.com 30 Jan 00:46
    Using parasites in script-fu Rob Antonishen 30 Jan 00:58
     Using parasites in script-fu Rob Antonishen 30 Jan 01:17
     Using parasites in script-fu Michael Schumacher 30 Jan 10:13
     Using parasites in script-fu Sven Neumann 30 Jan 22:00
      Using parasites in script-fu Rob Antonishen 30 Jan 22:52
      Using parasites in script-fu saulgoode@flashingtwelve.brickfilms.com 31 Jan 00:51
       Using parasites in script-fu Rob Antonishen 01 Feb 03:07
        Using parasites in script-fu Rob Antonishen 19 Feb 15:05
         Using parasites in script-fu Nathan Summers 19 Feb 17:11
          Using parasites in script-fu Rob Antonishen 23 Feb 17:10
Rob Antonishen
2009-01-29 22:11:13 UTC (almost 16 years ago)

Using parasites in script-fu

I see there are functions in the pdb to access parasites.

I am working on a script that I would like to maintain a global value for that will persist between images and thought I could create a global parasite.

I used this:
(car (gimp-parasite-find "exif-orientation-rotate"))

and got: ("exif-orientation-rotate" 1 "yes")

And looking at http://developer.gimp.org/api/2.0/libgimpbase/libgimpbase-gimpparasite.html#GimpParasite I am guessing the structure as presented in the pdb...

I tried to add my own global parasite by using

(gimp-parasite-attach (list "test-counter" 1 123)) and get an error "Invalid type for argument 1 to gimp-parasite-attach" which makes me think it doesn't want a list....or I don't know how to construct a parasite in scheme.

Can someome point me to a sample of handling parasites in scrip-fu?

Thanks,

-Rob A>

Rob Antonishen
2009-01-29 23:02:32 UTC (almost 16 years ago)

Using parasites in script-fu

OK -

This could be a problem with tinyscheme and parasites.

Here is a a console trace:

(gimp-parasite-list)

(1 ("exif-orientation-rotate"))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-list)

(2 ("exif-orientation-rotate" "test-counter"))

(gimp-parasite-find "test-counter")

(("test-counter" 1 ""))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-find "test-counter")

(("test-counter" 1 "123"))

The attach didn't work the first time, but did the second time.

-Rob A.

On Thu, Jan 29, 2009 at 4:11 PM, Rob Antonishen wrote:

I see there are functions in the pdb to access parasites.

I am working on a script that I would like to maintain a global value for that will persist between images and thought I could create a global parasite.

I used this:
(car (gimp-parasite-find "exif-orientation-rotate"))

and got: ("exif-orientation-rotate" 1 "yes")

And looking at http://developer.gimp.org/api/2.0/libgimpbase/libgimpbase-gimpparasite.html#GimpParasite I am guessing the structure as presented in the pdb...

I tried to add my own global parasite by using

(gimp-parasite-attach (list "test-counter" 1 123)) and get an error "Invalid type for argument 1 to gimp-parasite-attach" which makes me think it doesn't want a list....or I don't know how to construct a parasite in scheme.

Can someome point me to a sample of handling parasites in scrip-fu?

Thanks,

-Rob A>

Michael Schumacher
2009-01-29 23:16:07 UTC (almost 16 years ago)

Using parasites in script-fu

Rob Antonishen wrote:

This could be a problem with tinyscheme and parasites.

AFAIK you can only attach string values as parasites with Script-Fu.

Michael

Rob Antonishen
2009-01-30 00:25:21 UTC (almost 16 years ago)

Using parasites in script-fu

I figured that out. It still only seems to work some of the time, even with strings....

The only other code I found was for SIOD and the syntax has changed (no bytes-append command needed)

On Thu, Jan 29, 2009 at 5:16 PM, Michael Schumacher wrote:

Rob Antonishen wrote:

This could be a problem with tinyscheme and parasites.

AFAIK you can only attach string values as parasites with Script-Fu.

Michael

-- GIMP > http://www.gimp.org | IRC: irc://irc.gimp.org/gimp Wiki > http://wiki.gimp.org | .de: http://gimpforum.de Plug-ins > http://registry.gimp.org |

saulgoode@flashingtwelve.brickfilms.com
2009-01-30 00:46:09 UTC (almost 16 years ago)

Using parasites in script-fu

Quoting Rob Antonishen :

OK -

This could be a problem with tinyscheme and parasites.

Here is a a console trace:

(gimp-parasite-list)

(1 ("exif-orientation-rotate"))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-list)

(2 ("exif-orientation-rotate" "test-counter"))

(gimp-parasite-find "test-counter")

(("test-counter" 1 ""))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-find "test-counter")

(("test-counter" 1 "123"))

The attach didn't work the first time, but did the second time.

When I performed the above steps in the console, I did not encounter the anomaly you relate above. I have used parasites in various scripts without ever encountering such strange behavior.

Rob Antonishen
2009-01-30 00:58:25 UTC (almost 16 years ago)

Using parasites in script-fu

Thanks for the check. I am using Windows XP, Gimp 2.6.0

Any other suggestion?

-Rob A>

On Thu, Jan 29, 2009 at 6:46 PM, wrote:

Quoting Rob Antonishen :

OK -

This could be a problem with tinyscheme and parasites.

Here is a a console trace:

(gimp-parasite-list)

(1 ("exif-orientation-rotate"))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-list)

(2 ("exif-orientation-rotate" "test-counter"))

(gimp-parasite-find "test-counter")

(("test-counter" 1 ""))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-find "test-counter")

(("test-counter" 1 "123"))

The attach didn't work the first time, but did the second time.

When I performed the above steps in the console, I did not encounter the anomaly you relate above. I have used parasites in various scripts without ever encountering such strange behavior.

Rob Antonishen
2009-01-30 01:17:00 UTC (almost 16 years ago)

Using parasites in script-fu

Another update-

I restarted my compuyer and tried again. This time it took 5 times inthe console to come back:

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-list)

(2 ("exif-orientation-rotate" "test-counter"))

(gimp-parasite-find "test-counter")

(("test-counter" 1 ""))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-find "test-counter")

(("test-counter" 1 ""))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-find "test-counter")

(("test-counter" 1 ""))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-find "test-counter")

(("test-counter" 1 ""))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-find "test-counter")

(("test-counter" 1 ""))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-find "test-counter")

(("test-counter" 1 "123"))

It seems completely inconsistent. The parasite always gets created but more often than not has a "" value.

-Rob A>

On Thu, Jan 29, 2009 at 6:58 PM, Rob Antonishen wrote:

Thanks for the check. I am using Windows XP, Gimp 2.6.0

Any other suggestion?

-Rob A>

On Thu, Jan 29, 2009 at 6:46 PM, wrote:

Quoting Rob Antonishen :

OK -

This could be a problem with tinyscheme and parasites.

Here is a a console trace:

(gimp-parasite-list)

(1 ("exif-orientation-rotate"))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-list)

(2 ("exif-orientation-rotate" "test-counter"))

(gimp-parasite-find "test-counter")

(("test-counter" 1 ""))

(gimp-parasite-attach (list "test-counter" 1 "123"))

(#t)

(gimp-parasite-find "test-counter")

(("test-counter" 1 "123"))

The attach didn't work the first time, but did the second time.

When I performed the above steps in the console, I did not encounter the anomaly you relate above. I have used parasites in various scripts without ever encountering such strange behavior.

Michael Schumacher
2009-01-30 10:13:26 UTC (almost 16 years ago)

Using parasites in script-fu

Von: Rob Antonishen

Any other suggestion?

Please do not put your replies above the fully quoted messages you're replying to. Thanks.

Michael

Sven Neumann
2009-01-30 22:00:29 UTC (almost 16 years ago)

Using parasites in script-fu

Hi,

On Thu, 2009-01-29 at 18:58 -0500, Rob Antonishen wrote:

Thanks for the check. I am using Windows XP, Gimp 2.6.0

Any other suggestion?

First of all you should upgrade to GIMP 2.6.4. Whenever you have a problem, try to update to the latest stable release. You never know, it might even solve your problem.

Sven

Rob Antonishen
2009-01-30 22:52:20 UTC (almost 16 years ago)

Using parasites in script-fu

Thanks for the suggestion. I did upgrade but am seeing the same behaviour. It seems to be a race condition but I don't know if it is within the tinyscheme engine, the pdb calls, or the gimp core.

I can work around it by having the script set the parasite in a while loop checking to see if it really set. But I would like to see it fixed.

-Rob A>

On 1/30/09, Sven Neumann wrote:

Hi,

On Thu, 2009-01-29 at 18:58 -0500, Rob Antonishen wrote:

Thanks for the check. I am using Windows XP, Gimp 2.6.0

Any other suggestion?

First of all you should upgrade to GIMP 2.6.4. Whenever you have a problem, try to update to the latest stable release. You never know, it might even solve your problem.

Sven

saulgoode@flashingtwelve.brickfilms.com
2009-01-31 00:51:55 UTC (almost 16 years ago)

Using parasites in script-fu

Quoting Sven Neumann :

First of all you should upgrade to GIMP 2.6.4. Whenever you have a problem, try to update to the latest stable release. You never know, it might even solve your problem.

I can verify that the anomalous behavior Rob A. described occurs in version 2.6.5 (checked out last Sunday).

I had not previously noticed the problem in my own scripts and this is seemingly attributable to the fact that I always detached my parasites before attaching them anew. While my recent experiments have shown that doing this does not eliminate the problem completely, it appears to make its occurrence much less likely (two orders of magnitude lower).

Rob Antonishen
2009-02-01 03:07:48 UTC (almost 16 years ago)

Using parasites in script-fu

OK -

Attached is a simple parasite test script that should increment the value of a parasite each time it is run, creating it if it doesn't exist, and deleting it when the delete check box is ticked.

It works sometimes for me.

Overtimes it sites there in the while loop and I have to manually attach the parasite from the script-fu console to get the script to exit.

No idea what is wrong with this, and no idea how to fix it :(

(I assume the list allows attachments...)

Thanks in advance for any help.

-Rob A>

Rob Antonishen
2009-02-19 15:05:56 UTC (almost 16 years ago)

Using parasites in script-fu

Just an update.

I have tested gimp-parasite-attach on Ubuntu and it works fine. This seems to only be an issue with the windows version.

Also, I have repeated the test with gimp-image-parasite-attach and it works without problem.

Is this enough information that I should create a bug tracker entry?

-Rob A.

On Sat, Jan 31, 2009 at 9:07 PM, Rob Antonishen wrote:

OK -

Attached is a simple parasite test script that should increment the value of a parasite each time it is run, creating it if it doesn't exist, and deleting it when the delete check box is ticked.

It works sometimes for me.

Overtimes it sites there in the while loop and I have to manually attach the parasite from the script-fu console to get the script to exit.

No idea what is wrong with this, and no idea how to fix it :(

(I assume the list allows attachments...)

Thanks in advance for any help.

-Rob A>

Nathan Summers
2009-02-19 17:11:34 UTC (almost 16 years ago)

Using parasites in script-fu

On Thu, Feb 19, 2009 at 9:05 AM, Rob Antonishen wrote:

Is this enough information that I should create a bug tracker entry?

Definately!

Rockwalrus

Rob Antonishen
2009-02-23 17:10:52 UTC (almost 16 years ago)

Using parasites in script-fu

I have filed this as http://bugzilla.gnome.org/show_bug.cgi?id=572865

Hopefully someone here can conform the bug who is able to change it's status.

Also, I have tested attaching parasites in python and it works without problem, using the following in the console:

i = 0 while i < 10000:
i += 1
gimp.attach_new_parasite('test2', 1, 'data2') temp = pdb.gimp_parasite_find('test2') if temp == 'data2':
print 'bad'
pdb.gimp_parasite_detach('test2')

-Rob A>