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????