Fix color limit inversion support for image export #445
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.
Hi @ameraner , @strandgren , @sjoro ,
This PR provides the required fixes for issue #333:
To support the "color bar inversion" while generating the exported image we simply need to always map our color limit min/max values appropriately (ie. irrespectively of the name "vmax/vmin" that we use for those values): this part of the fix is included in the export_image.py file.
Now, on a similar not, in the layer_details.py conversions between QT physical units and dataset value units were not always properly taking into account that what we call "valid_max"/"valid_min" could also be inverted. So I introduced a few changes in that file too.
=> Overall, the image export feature now seems to work as expected for me with those changes. But of course, please let me know if you think there is anything we need to discuss/change before the PR can be accepted. Thanks 🙏!
Closes #333