[scribus] Placing /Scaling and file image/PDF size
Mike Breiding
mike at WildWonderfulWV.us
Fri Oct 31 14:09:47 CET 2008
alessandro rimoldi wrote:
> hi
> here you have the script to find out the width and the height of every picture in a .sla file:
Thanks for the script but that is exactly the opposite of what I am
trying to find out. ;)
I am trying to find out the dimensions of an image frame in pixels prior
to placing an image, not the sizes of frames already in use.
-Mike
> === 8< ===
>
> #!/usr/bin/python
> import re
>
> file = ""
> width = 0
> height = 0
>
>
> pf = re.compile('PFILE="([^"]+)')
> pw = re.compile('WIDTH="([^"]+)')
> ph = re.compile('HEIGHT="([^"]+)')
>
> f=open('/home/ale/test.sla', 'r')
> for line in f:
> if 'PTYPE="2"' in line :
> m = pf.search(line)
> if m :
> file = m.group(1)
> width = pw.search(line).group(1)
> height = ph.search(line).group(1)
>
> print file, width, height
>
> === 8< ===
>
>
> it's doable... but since you're scared by the python, i guess it's better not to give you the last part: resize the images with PIL or imagemagik: i don't want to be held responsible for some deletion of files on your system!
>
>
>
> good night!
> a.l.e
>
> _______________________________________________
> scribus mailing list
> scribus at lists.scribus.net
> http://lists.scribus.net/mailman/listinfo/scribus
>
>
More information about the scribus
mailing list