Splitting low-level routines, and exposing a “raw” access to the image array.#24
Merged
BobDenny merged 2 commits intoASCOMInitiative:masterfrom Jan 27, 2026
Merged
Conversation
…e array. Signed-off-by: Cédric Foellmi <cedric@onekiloparsec.dev>
Contributor
Author
|
Dear @BobDenny it seems you are the author of this fantastic lib, and I am pretty sure you may be busy with other tasks. But would you mind having a quick look at this PR? |
https://www.mend.io/vulnerability-database/CVE-2024-47081?utm_source=Jetbrains Signed-off-by: Cédric Foellmi <cedric@onekiloparsec.dev>
Collaborator
|
OK, looks great, I incorporated without changes. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR solves #23, and introduces a new accessor
ImageArrayRawto theCameraclass.Description
As explained in #23, there is a tiny issue with the
tcodeinferred when reading the image array from the camera. The typeslandLare not fully portable, since it doesn't work on macOS. On macOS, the C type "long" is 8 bytes, while on Linux and Windows it’s usually 4 bytes. Hence, it is recommended to change these toiandIrespectively, which are fully portable on every platform. I couldn't find an explicit Python ref to paste here unfortunately.While doing tests to validate the solution, it became obvious the low-level routine would benefit from a small refactoring, to be split in multiple smaller methods with separated concerns. This is what this PR also introduces.
The original accessor
def ImageArray(self)has been completely preserved. But in the case of binary data, the building of nested lists isn't always necessary, nor really desirable. Hence, thanks to the refactoring, it became possible to expose right-away thearray.array(which is anyway built) via a new accesordef ImageArrayRaw(self).Open questions / notes
l/L->i/Ichanges and the reafctoring, but I'm open to split the PR if you prefer.