Commit 622722f 1 parent 0e3f51d commit 622722f Copy full SHA for 622722f
File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -211,26 +211,27 @@ def tkPhotoImage(self) -> ImageTk.PhotoImage:
211
211
212
212
213
213
# given a list of filenames, return a list of images
214
- def loadImageSeries (filelist : list [str ] | None = None ) -> list [SpiderImageFile ] | None :
214
+ def loadImageSeries (filelist : list [str ] | None = None ) -> list [Image . Image ] | None :
215
215
"""create a list of :py:class:`~PIL.Image.Image` objects for use in a montage"""
216
216
if filelist is None or len (filelist ) < 1 :
217
217
return None
218
218
219
- imglist = []
219
+ byte_imgs = []
220
220
for img in filelist :
221
221
if not os .path .exists (img ):
222
222
print (f"unable to find { img } " )
223
223
continue
224
224
try :
225
225
with Image .open (img ) as im :
226
- im = im .convert2byte ()
226
+ assert isinstance (im , SpiderImageFile )
227
+ byte_im = im .convert2byte ()
227
228
except Exception :
228
229
if not isSpiderImage (img ):
229
230
print (f"{ img } is not a Spider image file" )
230
231
continue
231
- im .info ["filename" ] = img
232
- imglist .append (im )
233
- return imglist
232
+ byte_im .info ["filename" ] = img
233
+ byte_imgs .append (byte_im )
234
+ return byte_imgs
234
235
235
236
236
237
# --------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments