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

Fix numpy float/int error when using CameraAndroid.decode_frame #8754

Merged
merged 1 commit into from
Jun 22, 2024

Conversation

ewen-lbh
Copy link
Contributor

@ewen-lbh ewen-lbh commented Jun 11, 2024

the call to np.reshape with (h + h/2, ...) could lead to reshaping with a float. This is fixed by using h + h//2 instead

Closes #8752

Maintainer merge checklist

  • Title is descriptive/clear for inclusion in release notes.
  • Applied a Component: xxx label.
  • Applied the api-deprecation or api-break label.
  • Applied the release-highlight label to be highlighted in release notes.
  • Added to the milestone version it was merged into.
  • Unittests are included in PR.
  • Properly documented, including versionadded, versionchanged as needed.

the call to np.reshape with (h + h/2, ...) could lead to reshaping with
a float. This is fixed by using h + h//2 instead
Copy link

welcome bot commented Jun 11, 2024

Thanks for opening your first pull request here! 💖 Please check out our contributing guidelines.

@ewen-lbh
Copy link
Contributor Author

ewen-lbh commented Jun 11, 2024

I'd also like to backport this to 2.*, if you still do releases, as we are using the latest stable Kivyv version (and therefore not 3.*). The code for decode_frame is the same as on the latest 2.* version.

I cherry-picked my commit to https://github.com/audioseek/kivy/tree/2.3.0-8754-fix, which is based on 9ef2180

@misl6 misl6 changed the title Fix numpy float/int error when using CameraAndroid.decode_frame Fix numpy float/int error when using CameraAndroid.decode_frame Jun 22, 2024
@misl6 misl6 added this to the 3.0.0 milestone Jun 22, 2024
Copy link
Member

@misl6 misl6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@misl6
Copy link
Member

misl6 commented Jun 22, 2024

I'd also like to backport this to 2., if you still do releases, as we are using the latest stable Kivyv version (and therefore not 3.). The code for decode_frame is the same as on the latest 2.* version.

I cherry-picked my commit to https://github.com/audioseek/kivy/tree/2.3.0-8754-fix, which is based on 9ef2180

ATM we do not have another 2.x.x release scheduled, but we may be forced to make one if the 3.x.x is not ready before the end of the year, so stay tuned.

@misl6 misl6 merged commit e1afc57 into kivy:master Jun 22, 2024
27 checks passed
Copy link

welcome bot commented Jun 22, 2024

Congrats on merging your first pull request! 🎉🎉🎉

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

Successfully merging this pull request may close these issues.

'float' object cannot be interpreted as an integer when calling read_frame on a CameraAndroid
2 participants