Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error generated by PIL #17

Open
hphilamore opened this issue Jun 1, 2020 · 1 comment
Open

Type error generated by PIL #17

hphilamore opened this issue Jun 1, 2020 · 1 comment

Comments

@hphilamore
Copy link

Hi, I'm seeing the same issue as reported in a previous issue : Compatibility with Elegoo Mars? #8

I have a fresh virtual env, with python 3.7 and pyphotonfile installed according to your instructions.

When running the example script using a .photon file as the input, the following error is generated:

File "hemisphere.py", line 8, in
photon.export_images("tempdir")
File "//lib/python3.7/site-packages/pyphotonfile/photonfile.py", line 381, in export_images
self.export_image(sublayer, os.path.join(dirpath, '{:05d}_{:02d}.png'.format(i, j)))
File "/
/lib/python3.7/site-packages/pyphotonfile/photonfile.py", line 388, in export_image
Image.fromarray(img).convert('RGB').save(filepath)
File "/***/lib/python3.7/site-packages/PIL/Image.py", line 2716, in fromarray
raise TypeError("Cannot handle this data type: %s, %s" % typekey)
TypeError: Cannot handle this data type: (1, 1), <i8

On installing a previous version of pillow (v.5.2) the error instead appears as:

File "hemisphere.py", line 8, in
photon.export_images("tempdir")
File "//lib/python3.7/site-packages/pyphotonfile/photonfile.py", line 381, in export_images
self.export_image(sublayer, os.path.join(dirpath, '{:05d}_{:02d}.png'.format(i, j)))
File "/
/lib/python3.7/site-packages/pyphotonfile/photonfile.py", line 388, in export_image
Image.fromarray(img).convert('RGB').save(filepath)
File "/***/lib/python3.7/site-packages/PIL/Image.py", line 2463, in fromarray
raise TypeError("Cannot handle this data type")
TypeError: Cannot handle this data type

I'd really appreciate your help solving this issue.
Many thanks.

@fookatchu
Copy link
Owner

Sorry for the late reply! Could you give the recent pull request a try and report back if this fixes your problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants