Changeset 1216


Ignore:
Timestamp:
Feb 11, 2014 8:27:52 PM (8 years ago)
Author:
toby
Message:

supplement GetTifData? with PIL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIIO.py

    r1215 r1216  
    244244    if ext == '.tif' or ext == '.tiff':
    245245        Comments,Data,Npix,Image = GetTifData(imagefile)
     246        if Npix == 0:
     247            print("GetTifData failed to read "+str(filename)+" Trying PIL")
     248            import scipy.misc
     249            Image = scipy.misc.imread(imagefile,flatten=True)
     250            Npix = Image.size
     251            Comments = ['no metadata']
     252            Data = {'wavelength': 0.1, 'pixelSize': [200, 200], 'distance': 100.0}
     253            Data['size'] = list(Image.shape)
     254            Data['center'] = [int(i/2) for i in Image.shape]
     255            if not imageOnly:
     256                EditImageParms(G2frame,Data,Comments,Image,imagefile)
    246257    elif ext == '.edf':
    247258        Comments,Data,Npix,Image = GetEdfData(imagefile)
Note: See TracChangeset for help on using the changeset viewer.