Awesome.

2000-09-09 Thread MJR

When I first tried the Gimp it was still in its pre-1.0 days. It was
terribly slow, unrefined, and quite annoying.

But the latest versions are simply incredible. Nice work!


Mark Roberts
[EMAIL PROTECTED]




Re: calling script-fu from perl script

2000-09-09 Thread Marc Lehmann

On Fri, Sep 08, 2000 at 07:04:04PM -0500, "Michael J. Hammel" 
[EMAIL PROTECTED] wrote:
 $drawable-script_fu_drop_shadow("8", "8", "15", [0, 0, 0], "0", 1);

AFAICS, this should work.

 interactively.  I've also tried without the quotes (those are supposed to
 be STRINGS according to the PDB)

Which shouldn't matter, either (all the same for perl).

 gets resized) but immediately after making a selection around the current
 layer Gimp crashes.

gimp or script-fu? script-fu could never be called via the pdb, despite a lot
of effort to fix that, so script-fu breaking is not unexpected - gimp should
however, not really crash.

Could you add the following call before the call to drop_shadow:

Gimp::set_trace(-1);

and post the resulting trace output? This will help us find out what,
actually, is getting passed to script-fu (this is helpful in any case as
it shows wether you passed the arguments in correctly).

-- 
  -==- |
  ==-- _   |
  ---==---(_)__  __   __   Marc Lehmann  +--
  --==---/ / _ \/ // /\ \/ /   [EMAIL PROTECTED] |e|
  -=/_/_//_/\_,_/ /_/\_\   XX11-RIPE --+
The choice of a GNU generation   |
 |



Re: Newbie: LIBGD or GIMP?

2000-09-09 Thread Marc Lehmann

On Fri, Sep 08, 2000 at 04:08:16PM -, [EMAIL PROTECTED] wrote:
 1. One of the major requirements the solution should run as batch 
 process on AIX.

libgd - easy, gimp - difficult (you need an x display all the time, even
if only virtual).

 2. It should be able to create images from text in Helvetica Neue 
 font. 

gimp - easy, libgd - difficult (newer versions might support truetype
fonts).

-- 
  -==- |
  ==-- _   |
  ---==---(_)__  __   __   Marc Lehmann  +--
  --==---/ / _ \/ // /\ \/ /   [EMAIL PROTECTED] |e|
  -=/_/_//_/\_,_/ /_/\_\   XX11-RIPE --+
The choice of a GNU generation   |
 |



Re: calling script-fu from perl script

2000-09-09 Thread Marc Lehmann

On Sat, Sep 09, 2000 at 11:18:49AM -0500, "Michael J. Hammel" 
[EMAIL PROTECTED] wrote:

Thanks for the reply ;) I posted it to gimp-developer because i seems this
is a generic gimp bug and hope somebody else can add more.

 gimp.  I suspect (but it's a guess) that the second one causes a change to the
 drawable id's for the image (which starts with a single layer when
 old_photo gets to it).

If the script-fu-drop-sahdow does change the darwable id (creates a new
one and deleted the old one) then your code is buggy: you simply mustn't
call gimp functiosn on drawables that do not exist. In this case this
would also be a gimp-bug, however, since gimp is not supposed to crash
when you feed it nonexistant drawable id's.

 If this is the problem, perhaps setting a delay of some kind between the
 two would work. 

No, it wouldn't. A delay wouldn't change the drawable id. A delay would
help if script-fu would return to the gimp before it finished its work
(unlikely, but definitely not impossible), or gimp would do something
after it has forwared the results to perl.

 script_fu_drop_shadow(
 INT32 run_mode=1"Interactive, non-interactive"
 IMAGE image=-1  "Image"
 DRAWABLE drawable=2 "Drawable"
 
 Without the sleep() call, the last entry looks like this:
 
 script_fu_drop_shadow(
 INT32 run_mode=1"Interactive, non-interactive"
 IMAGE image=0   "Image"
 DRAWABLE drawable=2 "Drawable"

 Looks like the image id gets changed somehow.  Ideas?

Highly interesting indeed. Now, what gimp-perl does (when you pass in a
drawable instead of both image and drawable) is this:

if (sv_derived_from (sv, PKG_DRAWABLE))
  arg-data.d_image = gimp_drawable_image_id(unbless(sv, PKG_DRAWABLE, 
croak_str));

i.e. it calls gimp_drawable_image_id (or gimp_layer_get_image_id
etc..) to get the image, which in turn calls the the pdb function
gimp_drawable_image without any caches. This means that, temporarily, gimp
returns "-1" as the image id and later the correct one.

Here I have to give up and hope this rings a bell for somebody more tied
to the internals of gimp id management.

-- 
  -==- |
  ==-- _   |
  ---==---(_)__  __   __   Marc Lehmann  +--
  --==---/ / _ \/ // /\ \/ /   [EMAIL PROTECTED] |e|
  -=/_/_//_/\_,_/ /_/\_\   XX11-RIPE --+
The choice of a GNU generation   |
 |



Re: New text metric procedure

2000-09-09 Thread Marc Lehmann

On Wed, Sep 06, 2000 at 07:58:13PM -0400, Nick Marden [EMAIL PROTECTED] wrote:
 I was looking through the PDB for a good procedure to return the
 metrics of a text string a la gdk_string_extents() but all I could
 find was gimp-text-get-extents. Unfortunately it returns the ascent
 and descent of the font, not of the characters in the current string.

Isn't the first what you want, anyway? I can only guess that the real
problem is that gimp-text clips away part of the bounding box. Try using
-1 as border size, this should leave the standard ascent and descent space
around the charatcers, allowing you to align everything correctly.


-- 
  -==- |
  ==-- _   |
  ---==---(_)__  __   __   Marc Lehmann  +--
  --==---/ / _ \/ // /\ \/ /   [EMAIL PROTECTED] |e|
  -=/_/_//_/\_,_/ /_/\_\   XX11-RIPE --+
The choice of a GNU generation   |
 |



TGA plug-in patch

2000-09-09 Thread Brandon

Below is a patch to add support for saving TGA files upside down.  Although it sounds
strange to do, it is a supported feature of the file format and OpenGL expects its
textures to be upside down.  Support already exists for reading such files but it
was impossible to save them.

Brandon

Index: tga.c
===
RCS file: /cvs/gnome/gimp/plug-ins/common/tga.c,v
retrieving revision 1.20
diff -c -r1.20 tga.c
*** tga.c   2000/08/28 00:42:20 1.20
--- tga.c   2000/09/09 23:16:49
***
*** 95,105 
--- 95,107 
  typedef struct _TgaSaveVals
  {
gint rle;
+   gint vertrev;
  } TgaSaveVals;
  
  static TgaSaveVals tsvals =
  {
1,/* rle */
+   0,/* Bottom to Top ordering */
  };
  
  typedef struct _TgaSaveInterface
***
*** 1186,1192 
struct tga_header hdr;
  
int (*myfwrite)(guchar *, int, int, FILE *);
!   guchar *data;
  
drawable = gimp_drawable_get(drawable_ID);
dtype = gimp_drawable_type(drawable_ID);
--- 1188,1194 
struct tga_header hdr;
  
int (*myfwrite)(guchar *, int, int, FILE *);
!   guchar *data, *tmpbuf;
  
drawable = gimp_drawable_get(drawable_ID);
dtype = gimp_drawable_type(drawable_ID);
***
*** 1199,1205 
  
memset (hdr, 0, sizeof (hdr));
/* We like our images top-to-bottom, thank you! */
!   hdr.descriptor |= TGA_DESC_VERTICAL;
  
/* Choose the imageType based on our drawable and compression option. */
switch (dtype)
--- 1201,1210 
  
memset (hdr, 0, sizeof (hdr));
/* We like our images top-to-bottom, thank you! */
!   /* Not all of us :-P */
!   if (!tsvals.vertrev) {
! hdr.descriptor |= TGA_DESC_VERTICAL;
!   }
  
/* Choose the imageType based on our drawable and compression option. */
switch (dtype)
***
*** 1363,1369 
  {
/* Get a horizontal slice of the image. */
tileheight = MIN(tileheight, height - i);
!   gimp_pixel_rgn_get_rect(pixel_rgn, data, 0, i, width, tileheight);
  
  #ifdef VERBOSE
if (verbose  1)
--- 1368,1388 
  {
/* Get a horizontal slice of the image. */
tileheight = MIN(tileheight, height - i);
!   if (!tsvals.vertrev) {
! gimp_pixel_rgn_get_rect(pixel_rgn, data, 0, i, width, tileheight);
!   } else {
! gimp_pixel_rgn_get_rect(pixel_rgn, data, 0, MAX(height - i - tileheight, 
0), width, tileheight);
! bsize = width * pelbytes; /* the width of a row */
! tmpbuf = (guchar *) g_malloc(bsize);
! for (j = 0; j  tileheight/2; j++)
!   {
! memcpy(tmpbuf, data + (j * bsize), bsize);/* Move top row to the 
tmpbuf */
! memcpy(data + (j * bsize), data + ((tileheight - j - 1) * bsize),
!bsize);/* Move bottom row to the top */
! memcpy(data + ((tileheight - j - 1) * bsize), tmpbuf, bsize);
!   }
! g_free(tmpbuf);
!   }
  
  #ifdef VERBOSE
if (verbose  1)
***
*** 1473,1478 
--- 1492,1506 
  GTK_SIGNAL_FUNC (gimp_toggle_button_update),
  tsvals.rle);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), tsvals.rle);
+   gtk_widget_show (toggle);
+ 
+   /* Bottom to Top Ordering */
+   toggle = gtk_check_button_new_with_label (_("Upside Down Image"));
+   gtk_box_pack_start (GTK_BOX (vbox), toggle, FALSE, FALSE, 0);
+   gtk_signal_connect (GTK_OBJECT (toggle), "toggled",
+   GTK_SIGNAL_FUNC (gimp_toggle_button_update),
+   tsvals.vertrev);
+   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), tsvals.vertrev);
gtk_widget_show (toggle);
  
gtk_widget_show (vbox);



Moving selection content

2000-09-09 Thread Peter Kirchgessner

Hi,

when moving a selection with the move tool, the content of the selection
moves with the mouse. Is it possible to show only the border when moving
? I did not find such a setting in the preferences.
To me it is more easier to place a selection if I have a reference point
at the mouse cursor and move the mouse to the required position in the
current image. But the content of the selection is drawn over the
current image.

--Peter

-- 
Peter Kirchgessner
WWW:http://www.kirchgessner.net
e-mail: [EMAIL PROTECTED]