It is currently Mon Jun 15, 2026 3:22 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: strang remaing rectangle -.-.-.
PostPosted: Wed Jul 12, 2017 6:37 am  (#1) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
GIMP Version: 2.8.22
Operating System: Windows
OS Version: 10
GIMP Experience: Intermediate Level



Hallo,
I cut coins out of a *.tif with an own written PythonFu plugin.
Nearly all works as expected, the coin cut out is saved as tif and looks what
it should be.
The picture save I let stay in Gimp and is rather strange:
Image
See the -.-.- extra rectangle?
No way to remove it.

the relevant steps are:
            gimp.message(str(counter) + "   " + file)
            image = pdb.file_tiff_load(file,file)
            display = gimp.Display(image)   #PKHG>??? nicht unbedingt noetig
            select_quadrat();fuzzyselect();all4(0,0)
            LZW = 1
            compression = LZW
            save_transp_pixels =  True
            file = newName(file)
            pdb.file_tiff_save2(image, image.layers[-1], file, file , compression, save_transp_pixels)
            gimp.message(file)
            #pdb.gimp_display_delete(display)
            #pdb.gimp_image_delete(image)
    return


the do-er is all4 (its last lines are)
    pdb.gimp_image_crop(image, width, height, links, oben)
    pdb.gimp_selection_none(image)
    pdb.gimp_item_transform_rotate_simple(image.layers[0],0, 1,0,0)
    return ("links rechts oben unten",links, rechts, oben, unten, width, height)



Do you know this behavior ? What to do to get rid of that extra rectangle in the Gimp widow itself???

Greets
Peter


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: strang remaing rectangle -.-.-.
PostPosted: Wed Jul 12, 2017 8:10 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Dec 26, 2014
Posts: 205
I think this extra line should do it

pdb.gimp_item_transform_rotate_simple(image.layers[0],0, 1,0,0)
pdb.gimp_layer_resize_to_image_size(image.layers[0])
return ("links rechts oben unten",links, rechts, oben, unten, width, height)

steve


Top
 Post subject: Re: strang remaing rectangle -.-.-.
PostPosted: Wed Jul 12, 2017 8:16 am  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
This is just the indication of the boundary of your layer (which, as you can see, can extend outside the canvas). And your layer is wider than the canvas, because your image is higher than wide, so when you rotate the layer, its width, being the height of the image, is wider than the canvas.

Maye be you wanted to rotate the whole image (gimp_image_rotate()).

_________________
Image


Top
 Post subject: Re: strang remaing rectangle -.-.-.
PostPosted: Wed Jul 12, 2017 9:40 am  (#4) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
Both of you are right ... thanks, again a problem solved ;-)

Peter


Top
 Post subject: Re: strang remaing rectangle -.-.-.
PostPosted: Thu Jul 13, 2017 12:04 am  (#5) 
Offline
Global Moderator
User avatar

Joined: Apr 01, 2012
Posts: 8364
Location: On the other side of your screen
Glad you worked it out. :)
You could also merge another transparent layer onto it, which is what I do when that happens.

_________________
Image
Free Fun Photo Editing & resources
Poems from the Lord
Gimp Newby
Gimp version 3.2.0 and GMIC-Qt 3.7.5 OS :- Windows 10 Home 64


Top
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group