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

[script] resize image in pourcent

This discussion is connected to the gimp-user-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.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

[script] resize image in pourcent Didier Bretin 04 Jul 13:20
  [script] resize image in pourcent saulgoode@flashingtwelve.brickfilms.com 04 Jul 17:58
   [script] resize image in pourcent Didier Bretin 05 Jul 08:25
Didier Bretin
2009-07-04 13:20:45 UTC (over 15 years ago)

[script] resize image in pourcent

Hi,

I'm improving my script, and I would like to use the function gimp-image-scale and specify widht and height in pourcent, not in pixel.

Do you know how I can specify pourcent ?

Regards.

saulgoode@flashingtwelve.brickfilms.com
2009-07-04 17:58:55 UTC (over 15 years ago)

[script] resize image in pourcent

Quoting Didier Bretin :

I'm improving my script, and I would like to use the function gimp-image-scale and specify widht and height in pourcent, not in pixel.

Do you know how I can specify pourcent ?

You need to calculate the pixel values manually.

(gimp-image-scale image (* (car (gimp-image-width image)) x-pct 0.01) (* (car (gimp-image-height image)) y-pct 0.01) )

Didier Bretin
2009-07-05 08:25:57 UTC (over 15 years ago)

[script] resize image in pourcent

saulgoode@flashingtwelve.brickfilms.com wrote:

Quoting Didier Bretin :

I'm improving my script, and I would like to use the function gimp-image-scale and specify widht and height in pourcent, not in pixel.

Do you know how I can specify pourcent ?

You need to calculate the pixel values manually.

(gimp-image-scale image (* (car (gimp-image-width image)) x-pct 0.01) (* (car (gimp-image-height image)) y-pct 0.01) )

Yes ! Great, it works.

Thank you for your help.