Changeset 2325 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Jun 15, 2016 8:07:07 PM (7 years ago)
Author:
vondreele
Message:

fix fromstring error from newest pyOpenGL - now frombytes
will try one & do the other if error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r2311 r2325  
    662662                Pix = glReadPixels(0,0,size[0],size[1],GL_RGB, GL_UNSIGNED_BYTE)
    663663                im = Im.new("RGB", (size[0],size[1]))
    664             im.fromstring(Pix)
     664            try:
     665                im.frombytes(Pix)
     666            except AttributeError:
     667                im.fromstring(Pix)
    665668            im = im.transpose(Im.FLIP_TOP_BOTTOM)
    666669            im.save(Fname,mode)
     
    47294732                Pix = glReadPixels(0,0,size[0],size[1],GL_RGB, GL_UNSIGNED_BYTE)
    47304733                im = Im.new("RGB", (size[0],size[1]))
    4731             im.fromstring(Pix)
     4734            try:
     4735                im.frombytes(Pix)
     4736            except AttributeError:
     4737                im.fromstring(Pix)
    47324738            im = im.transpose(Im.FLIP_TOP_BOTTOM)
    47334739            im.save(Fname,mode)
     
    60906096                Pix = glReadPixels(0,0,size[0],size[1],GL_RGB, GL_UNSIGNED_BYTE)
    60916097                im = Im.new("RGB", (size[0],size[1]))
    6092             im.fromstring(Pix)
     6098            try:
     6099                im.frombytes(Pix)
     6100            except AttributeError:
     6101                im.fromstring(Pix)
    60936102            im = im.transpose(Im.FLIP_TOP_BOTTOM)
    60946103            im.save(Fname,mode)
Note: See TracChangeset for help on using the changeset viewer.