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

NumPy array with incorrect dtype silently proceeds #67

Closed
kyamagu opened this issue Jun 12, 2020 · 4 comments
Closed

NumPy array with incorrect dtype silently proceeds #67

kyamagu opened this issue Jun 12, 2020 · 4 comments

Comments

@kyamagu
Copy link
Owner

kyamagu commented Jun 12, 2020

Describe the bug
NumPy array conversion to, e.g., Image silently accepts array with types other than uint8.

To Reproduce

import skia
import numpy as np

array = np.zeros((100, 100), dtype=np.float32)
image = skia.Image(array)

Expected behavior
Should throw an error.

Desktop (please complete the following information):

  • OS: macOS 10.15.4
  • Architecture x86_64
  • Python 3.7
  • skia-python version v0.0.4

Additional context
n/a

@kyamagu
Copy link
Owner Author

kyamagu commented Jun 15, 2020

Resolved by #70

@kyamagu kyamagu closed this as completed Jun 15, 2020
@Correct-Syntax
Copy link

Correct-Syntax commented Jan 17, 2022

Hi @kyamagu, is this to say that only an array with uint8 datatype is supported?

@kyamagu
Copy link
Owner Author

kyamagu commented Jan 17, 2022

@Correct-Syntax See the available color types in the documentation.

@Correct-Syntax
Copy link

@kyamagu thank you.

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