-
Notifications
You must be signed in to change notification settings - Fork 502
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
MP jpegdec: fix width/height functions by opening file/buffer earlier #895
Conversation
Open file/buffer in open function rather than on demand. Also adds a close function for the user.
Thank you! I think we should probably copy the pattern from the PNG image parsing, since introducing a requirement on calling PNGDEC's bindings open the file, read out the dimensions, then close it until it's ready to be decoded: pimoroni-pico/micropython/modules/pngdec/pngdec.cpp Lines 292 to 321 in bff2453
|
Sorry I totally missed that you'd updated the PR! Will look into what's making the CI unhappy. Looks like it's Otherwise, thank you! |
having moved the opening code i'd missed the result variable getting reused later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd been silly and missed an int
declaration was all. should build fine now
References #894
Open file/buffer in open function rather than on demand.
Also adds a close function for the user.