Changeset 1397 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Jun 26, 2014 1:23:03 PM (8 years ago)
Author:
toby
Message:

Allow use of Image from pillow in place of PIL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r1396 r1397  
    33013301   
    33023302    def OnKeyBox(event):
    3303         import Image
    33043303#        Draw()                          #make sure plot is fresh!!
    33053304        mode = cb.GetValue()
    33063305        if mode in ['jpeg','bmp','tiff',]:
     3306            try:
     3307                import Image as Im
     3308            except ImportError:
     3309                try:
     3310                    from PIL import Image as Im
     3311                except ImportError:
     3312                    print "PIL/pillow Image module not present. Cannot save images without this"
     3313                    raise Exception("PIL/pillow Image module not found")
    33073314            Fname = os.path.join(Mydir,generalData['Name']+'.'+mode)
    33083315            size = Page.canvas.GetSize()
Note: See TracChangeset for help on using the changeset viewer.