r22877 by gpittman - fixed resizing of frames for images in InfoBox.py

scribus-commit scribus-commit at lists.scribus.net
Fri Mar 8 23:39:47 UTC 2019


Author: gpittman
Date: Fri Mar  8 23:39:47 2019
New Revision: 22877

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22877
Log:
fixed resizing of frames for images in InfoBox.py

Modified:
    trunk/Scribus/scribus/plugins/scriptplugin/scripts/InfoBox.py

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scripts/InfoBox.py
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22877&path=/trunk/Scribus/scribus/plugins/scriptplugin/scripts/InfoBox.py
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scripts/InfoBox.py	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scripts/InfoBox.py	Fri Mar  8 23:39:47 2019
@@ -23,7 +23,7 @@
 
 (C) 2005 by Thomas R. Koll, <tomk32 at gmx.de>, http://verlag.tomk32.de
 
-(c) 2008, 2010, 2012, 2018 modifications, additional features, and no need for PIL
+(c) 2008, 2010, 2012, 2018, 2019 modifications, additional features, and no need for PIL
 
 by Gregory Pittman
 
@@ -150,12 +150,14 @@
     else:
         if (frametype == 'imageL'):
             imageload = scribus.fileDialog('Load image','Images(*.jpg *.png *.tif *.JPG *.PNG *.jpeg *.JPEG *.TIF)',haspreview=1)
-            new_image = scribus.createImage(new_left, float(new_top), new_width, 100,framename)
+            new_image = scribus.createImage(new_left, float(new_top), new_width, float(new_height),framename)
             scribus.textFlowMode(new_image, 1)
             scribus.loadImage(imageload, new_image)
-            scribus.setScaleFrameToImage(new_image)
+            scribus.setScaleImageToFrame(1,0,new_image)
             currwidth, currheight = scribus.getSize(new_image)
-            scribus.sizeObject(new_width, currheight/currwidth*new_width, new_image)
+            Xscale, Yscale = scribus.getImageScale(new_image)
+            if (Xscale != Yscale):
+                scribus.sizeObject(currwidth, currheight*Xscale/Yscale, new_image)
             scribus.setScaleImageToFrame(1,1,new_image)
         else:
             new_image = scribus.createImage(new_left, float(new_top), new_width, float(new_height),framename)




More information about the scribus-commit mailing list