Ignore:
Timestamp:
Jan 12, 2021 12:47:56 PM (9 months ago)
Author:
vondreele
Message:

fix TIF importer for bad images that use PIL/pillow instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/imports/G2img_1TIF.py

    r4596 r4762  
    7373            import PIL.Image as PI
    7474            self.Image = PI.open(filename,mode='r')
    75             self.Image.shape = self.Image.size
     75#            self.Image.shape = self.Image.size
    7676            # for scipy 1.2 & later  scipy.misc.imread will be removed
    7777            # with note to use imageio.imread instead
     
    8282                self.Comments = ['no metadata']
    8383                self.Data = {'wavelength': 0.1, 'pixelSize': [200., 200.], 'distance': 100.0}
    84                 self.Data['size'] = list(self.Image.shape)
    85                 self.Data['center'] = [int(i/2) for i in self.Image.shape]
     84                # try:        #as suggested by Adam Creuziger 1/12/2021
     85                #     self.Data['size'] = list(self.Image.shape)
     86                # except:
     87                #     self.Data['size'] = list(self.Image.size)
     88                # try:
     89                #     self.Data['center'] = [int(i/2) for i in self.Image.shape]
     90                # except:
     91                #     self.Data['center'] = [int(i/2) for i in self.Image.size] 
     92                self.Data['size'] = list(self.Image.size)
     93                self.Data['center'] = [int(i/2) for i in self.Image.size]
    8694        if self.Npix == 0:
    8795            return False
Note: See TracChangeset for help on using the changeset viewer.