Closed cogliano closed 4 years ago
Thanks for the update, @cogliano! Thank you for testing this, @FoamyGuy!
Thank you @kattni and @FoamyGuy. This feature will be included in an upcoming learning guide I am working on.
@cogliano Thanks for letting me know. I did a release so your update will be included in the version in the library bundle. It will go in when the bundle builds next, likely today.
This code was added to allow multiple fetch() commands to work correctly when there is a mix of portrait and landscape oriented images to display on the PyPortal. An additional parameter, image_dim_json_path, was added to init() to point to the JSON section that contains the original width and height of the image. If this parameter (a width and height tuple) is not present, the fetch should work as before with no portrait mode considerations.
Here is an example of the feature being used. I commented out some of the lines so the code could run without external file dependencies. Specific landscape and portrait itemids can be uncommented for testing, or use the randomint() function.
More info on the api used in the example is here: https://openaccess-api.clevelandart.org/