It is currently Tue Sep 15, 2026 10:07 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Problem with gimp_layer_resize_to_image_size
PostPosted: Sun Oct 21, 2012 2:51 pm  (#1) 
Offline
GimpChat Member

Joined: Apr 14, 2011
Posts: 67
Location: The Netherlands
I'm updating my plugin (Indexprint) with a few new options but encountered a weird problem with gimp_layer_resize_to_image command.

A part of the code:
.
# Load an image as a new layer and scale to image size.
BGLayer = pdb.gimp_file_load_layer(sheetimg, background_image)
pdb.gimp_image_add_layer(sheetimg, BGLayer, -1)
pdb.gimp_layer_resize_to_image_size(BGLayer) #--works not always, why ????
pdb.gimp_layer_set_opacity(BGLayer, background_image_opacity)
.

The code above works but not every image is scaled. Some images scaled correctly others don't scale at all. My question why not??

From the Gimp api documentation (http://developer.gimp.org/api/2.0/libgi ... image-size) I found the following:
Quote:
gimp_layer_resize_to_image_size ()

gboolean gimp_layer_resize_to_image_size (gint32 layer_ID);

Resize a layer to the image size.

This procedure resizes the layer so that it's new width and height are equal to the width and height of its image container.

layer_ID :
The layer to resize.

Returns :
TRUE on success.

As you can see no information explaining my problem or give even a glimp to look at.

So what am I doing wrong????

_________________
Happy Gimping !!


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Problem with gimp_layer_resize_to_image_size
PostPosted: Sun Oct 21, 2012 3:26 pm  (#2) 
Offline
GimpChat Member

Joined: Sep 27, 2012
Posts: 11
I don't think this procedure is supposed to scale layers. It just changes the layer's dimensions. What you need is gimp-layer-scale.


Top
 Post subject: Re: Problem with gimp_layer_resize_to_image_size
PostPosted: Mon Oct 22, 2012 5:23 am  (#3) 
Offline
GimpChat Member

Joined: Apr 14, 2011
Posts: 67
Location: The Netherlands
I think you are right I will give it a try.

(edit 10/22)
You are right gimp_layer_scale does the job, thank you.

_________________
Happy Gimping !!


Top
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group