Scale and position image in Scribus

142 views Asked by At

I am customizing the built-in CalendarWizard Python script in Scribus to add birthdays with pictures. I have the profile pictures in a folder for each person and I would like to save scale and position information for these pictures, so they are automatically applied when the calendar is generated. The image box is created like:

 kep = createImage(self.marginl + colCnt * self.colSize,
                      self.calHeight + szovegsor + rowCnt * self.rowSize,
                      self.colSize, kepsor)

Then I fill the box with the photo:

szkep = 'C:\\profilepics\\' + sznapos + '.jpg'
kkep = loadImage(szkep,kep)

The sznapos variable contains the name of the current birthday person. So far we don't have multiple birthdays. The next action would be to scale the loaded image. I can fit to the box:

setScaleImageToFrame(1, 1, kep)

This works. But what I would like is to scale the image by a given value, but I am not sure how. Tried, first with static values 2 ways:

setImageScale(0.1,0.1,kep)
scaleImage(0.1, 0.1, kep)

Expected to scale the image to 10%, but remains at 100%. No error is raised, just nothing happens. Can somebody please tell me what am I doing wrong?

Edit: I tried to shift the image to filter out other possible issues and this works as expected:

setImageOffset(10,10,kep)

The image is shifted with 10 points both directions. Only scaling doesn't work.

1

There are 1 answers

0
vilmarci On

Finally, I found a workaround here: http://forums.scribus.net/index.php?topic=94.0

In my case: setProperty(kep, 'imageXScale', xscale)