Author Topic: Fill image frame script works on 1.5svn but not 1.4.2  (Read 1690 times)

dimitarsp

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
  • Scribus User
Fill image frame script works on 1.5svn but not 1.4.2
« on: May 13, 2013, 02:10:30 pm »
Hello,

I have tried all the fill image frame scripts posted on scribus.net on 1.4.2 and none of them worked with more than one image, so then I modified one of them a bit, but still with no result. then, I tried the modified one in 1.5 SVN and it worked. I have tried it on 3 1.4.x version with no success: the official one from the Ubuntu repo: 1.4.0, the latest stable 1.4.2, and currently on 1.4.3 SVN.

The following works only for a single image in 1.4.x and for as many as selected in 1.5. Any idea how to make it work for multiple ones in 1.4.x?

Code: [Select]
from scribus import *
import os

objList = []

for i in range(selectionCount()):
    objList.append(getSelectedObject(i))

for obj in objList:
    #setScaleImageToFrame(confined to frame = bool, proportional = bool, name)
    setScaleImageToFrame(True, False, obj)
    scaleX, scaleY = getImageScale(obj)
    setScaleImageToFrame(False, True, obj)
    if scaleX > scaleY:
        scale = scaleX
        setImageScale(scale, scale, obj)
    elif scaleY > scaleX:
        scale = scaleY
        setImageScale(scale, scale, obj)
       
setRedraw(True)
« Last Edit: May 13, 2013, 02:39:41 pm by dimitarsp »

hvfrancesco

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
  • Scribus User
Re: Fill image frame script works on 1.5svn but not 1.4.2
« Reply #1 on: June 19, 2013, 10:32:27 am »
try moving the act of "selecting" a single object inside the "for" cycle.
I've experienced some similar issue, and found that in many cases operating on the currently selected object works, while the corresponding command using the name of the object does not.

 

palmate