newbe- mapscript /pil
Didrik Pinte
dpinte at ITAE.BE
Wed Jul 13 05:10:27 PDT 2005
Le mercredi 13 juillet 2005 à 06:16 -0500, Richard Alexander a écrit :
> hi
> I want to open an image created by mapscript using PIL...
>
> I'm using python2.3 on Suse Linux Enterprise Server 9 (not this windows
> machine so there may be some minor punctuation errors below)
>
> from Tkinter import *
> import mapscript
> import Image
>
> theMap = mapscript.mapObj('/srv/www/htdocs/workshop/itasca.map')
> theMapImage = theMap.draw()
>
> theMapImage.save('srv/www/htdocs/workshop/tmp.png')
> #the above line produces a png image in the correct folder
>
> theImage = Image.open('srv/www/htdocs/workshop/tmp.png')
> #the above line causes an IOError to be thrown which seems to
> #be triggered by the Load function...
>
> #end
>
> After the program finishes I can open the png image tmp.png in all
> other graphics programs - Pil continues to refuse to open it !
>
> any ideas ?
>
> cheers
> RA
It seems that you need to use absolute path everywhere in your code.
theImage = Image.open('srv/www/htdocs/workshop/tmp.png') needs to be
theImage = Image.open('/srv/www/htdocs/workshop/tmp.png')
No ?
Didrik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050713/62efaace/attachment.sig>
More information about the MapServer-users
mailing list