On 25 Dez., 03:15, Yuval Levy <goo...@levy.ch> wrote:

> Probably Kay will find plenty of ways to improve on this.

Okay, first improvement. Your script assumes that all pto line members
are in static positions, like the filename being in the 34th field.
This may be the case, but it's much safer to use named member access
(and it's shorter as well ;-) - try:

def imgfile_to_i_lines ( scan ) :

    scan.make_member_access() # makes accessing the data more
comfortable ;-)

    for line in scan.i :                      # look at all i-lines
        width = line.w.value             # extract the desired values
        height = line.h.value
        name = line.n.value

        # generate random RGB values for the placeholder image
       #  ..... continue here as you did

I also find it questionable that the dummy images are created with the
same path and name as they were stored in the original pto. What do
you do if the pto contains full path names (like /home/theUser/images/
xyz.tif) - the system won't be able to create the file, or, what would
be worse, it might overwrite something which is there already (your
imagemagick system command just overwrites any innocent victim living
there). I'll propose an alternative and post when it's done.

Kay

-- 
You received this message because you are subscribed to the Google Groups 
"Hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

Reply via email to