-
Notifications
You must be signed in to change notification settings - Fork 26
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
axes fix for loading JPG with no exif_tags #283
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #283 +/- ##
==========================================
+ Coverage 86.33% 86.52% +0.18%
==========================================
Files 83 83
Lines 10674 10676 +2
Branches 2332 2332
==========================================
+ Hits 9215 9237 +22
+ Misses 940 922 -18
+ Partials 519 517 -2 ☔ View full report in Codecov by Sentry. |
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.
Thanks, this looks good, I left two comments.
rsciio/utils/image.py
Outdated
# return of axes must not be empty, or dimensions are lost | ||
offsets = [0,0] | ||
scales = [sizes[1],sizes[0]] | ||
unit = "pixel" |
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.
In this case, the standard pattern is to set to None and in hyperspy will be parsed a traits.api.undefined
value.
unit = "pixel" | |
unit = None |
rsciio/utils/image.py
Outdated
# if no exif_tags exist, axes are set to scale of 1 pixel/pixel | ||
# return of axes must not be empty, or dimensions are lost | ||
offsets = [0,0] | ||
scales = [sizes[1],sizes[0]] |
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.
While you are at it and in the interest of readability, can you please rename here and in the two other places below to
scales = [sizes[1],sizes[0]] | |
fiels_of_views = [sizes[1],sizes[0]] |
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.
Thanks, did the changes, also set unit to "None".
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
Description of the change
A few sentences and/or a bulleted list to describe and motivate the change:
Progress of the PR
upcoming_changes
folder (seeupcoming_changes/README.rst
),docs/readthedocs.org:rosettasciio
build of this PR (link in github checks)Minimal example of the bug fix or the new feature