Re: [Gimp-user] Unable to use 'system' command for script-fu

2007-03-11 Thread Sven Neumann
Hi,

On Sat, 2007-03-10 at 23:25 -0500, Tony Freeman wrote:
 OK, I found this site ... I'll be studying this for a while :-)
 
 http://developer.gimp.org/plug-in-template.html

The plug-in template is more about packaging and distributing a complex
plug-in for GIMP than about writing a simple one. You don't need most of
the things covered there. A simple .c file compiled and installed with
gimptool should be sufficient.


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Unable to use 'system' command for script-fu

2007-03-11 Thread John R. Culleton
On Sunday 11 March 2007 01:04, Joao S. O. Bueno Calligaris wrote:
 On Sunday 11 March 2007 01:25, Tony Freeman wrote:
  OK, I found this site ... I'll be studying this for a while :-)
 
  http://developer.gimp.org/plug-in-template.html

 You really be better trying out pythhon scripts first.


However I find that recent versions of Gimp blow up on compile unless 
one disables Python capability.  I use Slackware Linux.
-- 
John Culleton
Able Indexing and Typesetting
Precision typesetting (tm) at reasonable cost.
Satisfaction guaranteed. 
http://wexfordpress.com

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] pygimp doesn't build during Gimp 2.3.15 build

2007-03-11 Thread Tom Williams
I'm posting this question here to see if it's a Python environment issue 
on my end or something in Gimp 2.3.15.  I'm building Gimp 2.3.15 from 
source on a freshly re-installed Ubuntu 6.10 (AMD64) Linux system.  Here 
is my build environment information:

gcc-4.1.2 20060928 (prerelease)
2.6.17 kernel (x86_64)
glib-2.12.4
gtk+-2.10.6
python 2.4.4c1

When I run the Gimp build, it stops with this error:

 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I/usr/include/python2.4 
-I/usr/include/pygtk-2.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/gtk-2.0 
-I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo 
-I/usr/include/pango-1.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -DGIMP_DISABLE_DEPRECATED 
-DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED 
-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED 
-DPANGO_DISABLE_DEPRECATED -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE 
-fno-strict-aliasing -g -O2 -Wall -Wdeclaration-after-statement 
-Wmissing-prototypes -Wmissing-declarations -Winit-self -Wpointer-arith 
-MT gimpuimodule.lo -MD -MP -MF .deps/gimpuimodule.Tpo -c 
gimpuimodule.c  -fPIC -DPIC -o .libs/gimpuimodule.o
gimpuimodule.c:49: warning: no previous prototype for 'init_gimpui'
(cd . \
  /usr/bin/pygtk-codegen-2.0 \
--override gimpui.override \
--register /usr/share/pygtk/2.0/defs/gdk-types.defs \
--register /usr/share/pygtk/2.0/defs/gtk-types.defs \
--register ./gimpcolor-types.defs \
--register ./gimpenums-types.defs \
--prefix gimpui gimpui.defs)  gen-gimpui.c \
  cp gen-gimpui.c gimpui.c \
  rm -f gen-gimpui.c
Warning: generating old-style constructor for:gimp_color_display_new
Could not write method GimpColorDisplay.load_state: No ArgType for 
GimpParasite*
Could not write method GimpColorDisplay.save_state: No ArgType for 
GimpParasite*
Warning: generating old-style constructor for:gimp_color_selector_new
Warning: generating old-style constructor for:gimp_frame_new
Could not write method GimpIntComboBox.prepend: varargs functions not 
supported
Could not write method GimpIntComboBox.append: varargs functions not 
supported
Could not write method GimpIntComboBox.connect: No ArgType for GCallback
Could not write method GimpIntComboBox.set_sensitivity: No ArgType for 
GimpIntSensitivityFunc
Warning: generating old-style constructor for:gimp_enum_combo_box_new
Warning: generating old-style constructor for:gimp_enum_store_new
Warning: generating old-style constructor for:gimp_memsize_entry_new
Warning: generating old-style constructor for:gimp_offset_area_new
Could not write method GimpPageSelector.get_selected_pages: No ArgType 
for gint*
Warning: generating old-style constructor for:gimp_path_editor_new
Could not write method GimpPreview.get_position: No ArgType for gint*
Could not write method GimpPreview.get_size: No ArgType for gint*
Could not write method GimpPreviewArea.draw: No ArgType for GimpImageType
Could not write method GimpPreviewArea.blend: No ArgType for GimpImageType
Could not write method GimpPreviewArea.mask: No ArgType for GimpImageType
Could not write method GimpDrawablePreview.get_drawable: No ArgType for 
GimpDrawable*
Could not write method GimpDrawablePreview.draw_region: No ArgType for 
const-GimpPixelRgn*
Warning: generating old-style constructor for:gimp_size_entry_new
Could not write constructor for GimpSizeEntry: No ArgType for GimpUnit
Could not write method GimpSizeEntry.get_unit: No ArgType for GimpUnit
Could not write method GimpSizeEntry.set_unit: No ArgType for GimpUnit
Warning: generating old-style constructor for:gimp_unit_menu_new
Could not write constructor for GimpUnitMenu: No ArgType for GimpUnit
Could not write method GimpUnitMenu.set_unit: No ArgType for GimpUnit
Could not write method GimpUnitMenu.get_unit: No ArgType for GimpUnit
Could not write method GimpZoomModel.get_fraction: No ArgType for gint*
Could not write method GimpZoomPreview.get_source: No ArgType for gint*
Could not write method GimpZoomPreview.get_drawable: No ArgType for 
GimpDrawable*
Traceback (most recent call last):
  File /usr/share/pygtk/2.0/codegen/codegen.py, line 1707, in ?
sys.exit(main(sys.argv))
  File /usr/share/pygtk/2.0/codegen/codegen.py, line 1698, in main
sw.write(py_ssize_t_clean)
  File /usr/share/pygtk/2.0/codegen/codegen.py, line 1340, in write
self.write_classes()
  File /usr/share/pygtk/2.0/codegen/codegen.py, line 1437, in 
write_classes
instance.write_class()
  File /usr/share/pygtk/2.0/codegen/codegen.py, line 283, in write_class
substdict['tp_methods'] = self.write_methods()
  File /usr/share/pygtk/2.0/codegen/codegen.py, line 519, in write_methods
methods.append(self.methdef_tmpl %
UnboundLocalError: local variable 'meth' referenced before assignment
make[4]: *** [gimpui.c] Error 1
make[4]: Leaving directory `/mnt/data/build/gimp-2.3.15/plug-ins/pygimp'
make[3]: *** [all-recursive] Error 1

Re: [Gimp-user] Unable to use 'system' command for script-fu

2007-03-11 Thread Joao S. O. Bueno Calligaris
On Saturday 10 March 2007 23:30, John R. Culleton wrote:
 On Sunday 11 March 2007 01:04, Joao S. O. Bueno Calligaris wrote:
  On Sunday 11 March 2007 01:25, Tony Freeman wrote:
   OK, I found this site ... I'll be studying this for a while :-)
  
   http://developer.gimp.org/plug-in-template.html
 
  You really be better trying out pythhon scripts first.

 However I find that recent versions of Gimp blow up on compile
 unless one disables Python capability.  I use Slackware Linux.


Please, take a look at the fix available here:
http://bugzilla.gnome.org/show_bug.cgi?id=381389

Newer versions of pygtk, as they come out, will have this fix 
implemented.,

Forgot 2 other things:

4) you get the system  as in:

import os
os.system (your command here)

although, if you take a look at the api docs in www.python.org, you 
soon will find yourself needing 'system' very little


5) Although I said  that if you need to iterate over every pixel , 
you'd be better using a C plug-in, you _can_   do it in python (which 
does not happen with script-fu) - the only issue is that it is 
painfully slow to do so - but it can work as a  prototype for aC 
plug-in.

js
--
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Unable to use 'system' command for script-fu

2007-03-11 Thread Tony Freeman
Thanks Joao,

I see what you mean about C.  I just tried to do a drop shadow in C and 
could not find any examples.

I'm reading the python-fu stuff now :-)

-- Tony



Joao S. O. Bueno Calligaris wrote:
 On Sunday 11 March 2007 01:25, Tony Freeman wrote:
   
 OK, I found this site ... I'll be studying this for a while :-)

 http://developer.gimp.org/plug-in-template.html
 

 You really be better trying out pythhon scripts first.

 Only if you intend to perform image processing  - like performign some 
 algorithm on a pixel by pixel basis you'd have some advantage 
 writting a plug-in in C nowadays.

 The URL you did not find is:

 http://www.gimp.org/docs/python/index.html
 Also, take a look at the example plug-instahtcome withthe GIMP, anbd 
 try some python commands at the python console.
 Onm the python console, btw, start with:

 from gimpfu import *
 img = gimp.list_images()[0]

 --
 now you have your first image open in the gimp as a python object 
 named img, and you can do :

 dir (img)  


 (for example:
  img.scale (img.width * 0.5, img.height * 0.5)
 )

 to see the methods and properties available.

 Under the module pdb you have all the procedural database api, which 
 you can browse with xtns-Procedure Browser,as in:

 pdb.gimp_drawable_fill (img.layers[0], FOREGROUND_FILL)

 (followed by gimp.displays_flush() to see the effect)
  
 all procedure names use  _ instead of -, and ignore (do not pass) 
 interactive/non-interactive parameters.

 .
 Now if you know that:
 1) python blocks like procedure bodys, if blocks, for loop blocks are
delimited only by intendation level, and statements that accept
blocks end with a collon
 2) The python for statement iterates over a list, and if you want
numbers, use the xrange built-in function like:
 for i in xrange(1,11):
print i
 3) it is easier if you copy the call to the register function from
an existing script and just update the entries for your case

 you are ready for python scripting.

 But, if you want to create a custom gtk+ interface instead of the 
 script-fu like automathed dialog, it is also possible - again, check 
 the docs and examples.

   js
   --




   
 -- Tony
 
 ___
 Gimp-user mailing list
 Gimp-user@lists.XCF.Berkeley.EDU
 https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


   
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] pygimp doesn't build during Gimp 2.3.15 build

2007-03-11 Thread Sven Neumann
Hi,

On Sun, 2007-03-11 at 08:23 -0700, Tom Williams wrote:
 I'm posting this question here to see if it's a Python environment issue 
 on my end or something in Gimp 2.3.15.

http://bugzilla.gnome.org/show_bug.cgi?id=381389


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Unable to use 'system' command for script-fu -- Almost done

2007-03-11 Thread Tony Freeman
Almost done!

One last thing that I cannot figure out is:  how do you close the dialog 
box that the image is sitting in?  In Scheme you do it like so:

(gimp-display-delete Image)

I've tried the following (with variations), but it causes the python-fu 
to hang:

pdb.gimp_display_delete(img)

Anyway ... here's the code so far:

#!/usr/bin/env python

#   Send to Web - Re-samples an image, adds drop shadow, and saves it
# to ls1 www images directory so that it can be used
# in a 'Top News of the Day' article.

import os
from gimpfu import *

def python_send_to_web(img, drawable, filename):
img.disable_undo()
   
# local variables:
SRCFilename = /tmp/ + filename
RemoteDirectory = ls1:/home/tony/
SCPProgram = /usr/bin/scp
   
width = img.width
height = img.height

# hack to make the next section work:
blank_layer = gimp.Layer(img, blank, width, height, RGB_IMAGE, 0, 
NORMAL_MODE)
img.add_layer(blank_layer, 0)
gimp.displays_flush()
   
# merge all the layers for just in case the user has done some editing:
pdb.gimp_image_merge_visible_layers(img, 0)
# screwed up the drawable when I merged the layers:
drawable = pdb.gimp_image_get_active_drawable(img)
   
# scale the image if it's too big:
if (width  470):
newheight = ((height * 470) / width)
pdb.gimp_image_scale(img, 470, newheight)
gimp.displays_flush()
   
# add a drop shadow:
pdb.script_fu_drop_shadow(img, drawable, 8.0, 8.0, 15.0, [0,0,0], 
80.0, TRUE)
gimp.displays_flush()
   
# final layer merge:
pdb.gimp_image_merge_visible_layers(img, 0)
drawable = pdb.gimp_image_get_active_drawable(img)
   
# save the image in png format to disk:
pdb.file_png_save2(img, drawable, SRCFilename, filename, FALSE, 6, 
TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE)
gimp.displays_flush()
   
# close the python-fu dialog box:
gimp.delete(img)
   
# send the image to our ls1 directory:
command = SCPProgram +   + SRCFilename +   + RemoteDirectory
os.popen(command)
   
# user needs some feedback:
pdb.gimp_message(Cool!  Your picture is online.  You may now 
include it in a 'Top News of the Day' article.)
   
# I'd like to be able to close the dialog that the image is sitting 
in ...
# but I cannot figure out how to do this.  I'll leave it open.  
Hopefully the
# user will not be too confused by this.
#pdb.gimp_display_delete(img)


register(
python_fu_send_to_web,
Send an image to ls1 rsync directory,
Send image to ls1 for rsync to web farm after resampling it to 
proper size and adding drop shadow.,
Tony Freeman [EMAIL PROTECTED],
National Weather Service, Louisville,
2007,
Image/NWS/Send to web...,
RGB*, GRAY*,
[
(PF_STRING, filename, Filename, web-image.png),
],
[],
python_send_to_web)

main()

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Feather

2007-03-11 Thread Bhikkhu Mettavihari
Hello Friends,

I think there is a facility in Photoshop which is  called Feather,
Sorry but I do not use Photoshop, I only saw someone using it.

What would the similar feature be in Gimp
It is used to make the edges of part of a layer to alpha
so that the below image become visible,
(visually merge with the below layer)


regards
Mettavihari

-- 
Streaming video from http://dharmavahini.tv
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


[Gimp-user] Script-Fu error

2007-03-11 Thread Stephan Hegel
Hi there,

I've tried Gimp 2.3.15 with the following script:
http://turtle.as.arizona.edu/jdsmith/exposure-blend.scm

When launching Gimp I get the following error:

script-fu-Warning: Error while executing
(load /home/steve/.gimp-2.3/scripts/exposure-blend.scm)
Error: set!: unbound variable: script-fu-exposure-blend-options

The same plug-in behaves just fine in Gimp-2.2. Any hint what's
wrong and/or how to track this down ?

Kind regards,
Stephan.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Feather

2007-03-11 Thread Axel Wernicke
You can feather any selection in GIMP. Feel free to read the manual  
at http://docs.gimp.org/en/gimp-concepts-selection.html and give it a  
try.

Greetings, lexA


Am 12.03.2007 um 05:31 schrieb Bhikkhu Mettavihari:

 Hello Friends,

 I think there is a facility in Photoshop which is  called Feather,
 Sorry but I do not use Photoshop, I only saw someone using it.

 What would the similar feature be in Gimp
 It is used to make the edges of part of a layer to alpha
 so that the below image become visible,
 (visually merge with the below layer)


 regards
 Mettavihari

 -- 
 Streaming video from http://dharmavahini.tv
 ___
 Gimp-user mailing list
 Gimp-user@lists.XCF.Berkeley.EDU
 https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

---
Live is like a chocolate box, you never know what you wanna get...
GPG Signatur auf http://wernicke-online.net/Impressum/ prüfen


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user