On Monday 18 October 2004 13:45, [EMAIL PROTECTED] wrote:
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf
> > Of Steve Crane
> > Sent: 16 October 2004 00:01
> > To: [EMAIL PROTECTED]
> > Subject: [Gimp-user] Scheme question
> >
> > At the moment I am trying to work out how to do integer
> > division.  I want to draw guides mapping the rule of thirds
> > and want to ensure that I get an integer result when I divide
> > the image height and width by 3.
> > How would I do this?
> >
> > Thanks
> > --
>
> There is no internal function to convert to integer, but the
> following will do it:
> (define (floor x) (- x (fmod x 1)))

I may be pushing it too hard...may be going off topic. But I will 
insist on this subject. I'd like to see more people using gimp 
python.

Getting the integer part of a image width and height would be as 
complex as:
width_3 = image.width / 3
heigth_3 = image.height / 3

where "image" is an image object passed by ptyhon-fu to every python 
script that needs an image as a parameter. As both numbers on above 
opertaions are int, so is the result. Would one need the integer 
number of a division by 2.5:
width_25 = int (image.width / 2.5)

Regards,

        JS
        -><-
> _______________________________________________
> Gimp-user mailing list
> [EMAIL PROTECTED]
> http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user
_______________________________________________
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user

Reply via email to