Skip to content
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

Icchen/81 high resolution export #113

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

I-Chenn
Copy link
Contributor

@I-Chenn I-Chenn commented May 15, 2023

@confluence
This draft PR is to resolve #81.

An argument image_ratio and several steps are added into save_rendered_view to output png-image with different image ratio:
Setting setIsExportingImage to True enables setting output image ratio by calling setImageRatio. After writing the data to the file, we set setIsExportingImage to False and reset the image ratio to 1 with resetImageRatio.

The new-configured function does work for a new opened session. With the script like:

session.save_rendered_view(file_name="/home/icchen/Pictures/test/test_4.png", image_ratio=4)

I am able to generate a reolution = 400% png image like:
test_4
Nevertheless, there's something really odd: after a period of time (say 20 - 30 mins) without touching anything, the exact same execution will then generate something like:
test_4a
The image is still with the same 400% resolution in size, but the output content seems to lock to 100% resolution.

I still have no idea what's the reason that causes the phenomena, but I will discuss with @YuHsuan-Hwang and see if there's any mechanism at frontend will causes that.

@I-Chenn I-Chenn requested a review from confluence May 15, 2023 11:45
Copy link
Collaborator

@confluence confluence left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image ratio parameter should be added to all three functions for retrieving data -- rendered_view_url, rendered_view_data as well as save_rendered_view. The user could access any of these stages directly. setImageRatio, resetImageRatio and setIsExportingImage should be called from the innermost function (rendered_view_url).

@I-Chenn
Copy link
Contributor Author

I-Chenn commented May 17, 2023

@confluence I made some modifications according to your suggestions, the issue mentioned above (lock to 100% resolution issue after 20 - 30 mins) is still appearing. I firstly thought it probably due to: we reset the image_ratio to 1 not until the data is written into the png file (and that's the reason I want to call resetImageRatio in save_rendered_view after the writing file line). Nevertheless, it seems that the issue still appears if I do so. Will keep investigating for the cause of the issue.

@I-Chenn
Copy link
Contributor Author

I-Chenn commented May 17, 2023

@confluence, another issue is that we need to restrict the image_ratio. Do you think if it's proper to set 5 as the upper limit for image_ratio?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support a resolution scaling factor for export-as-png
2 participants