-
Notifications
You must be signed in to change notification settings - Fork 164
Suppress warnings for getImageDataAtCurrentZoom() #1938
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
base: master
Are you sure you want to change the base?
Conversation
Test Results 539 files ±0 539 suites ±0 27m 53s ⏱️ - 4m 47s For more details on these failures, see this check. Results for commit 4f8a6ac. ± Comparison against base commit fbdacfb. ♻️ This comment has been updated with latest results. |
I’d like to proceed with merging this if there are no objections |
getImageDataAtCurrentZoom();
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.
I am bit hestitant with respect to this change, as this is example code which is supposed to show how to use something, but using a deprecated method is obviously nothing one should do. On the other hand, I do currently not have a better solution (except passing DPIUtil.getDeviceZoom()
to the ordinary getImageData()
).
This seems to be one the last usage of the getImageAtCurrentZoom()
method (except for a test method), so in my opinion we should rather try to get rid of it.
@akoch-yatta do you have an idea how to properly get rid of the getImageDataAtCurrentZoom()
here?
Isn't that the perfect solution for such an example?
|
There are two problems with that approach:
In this case, it's about retrieving image data in some zoom that did not apply any auto-scaling as via clipboard you cannot pass a proper image with according metadata but only the image data for some specific zoom, so they should have the best available quality. But you may have images that can provide image data in any zoom of best quality (like those rendered from SVGs). Since you don't know where data from a clipboard will be used, you can only use some data in a best-effort manner. Maybe, in the case where you really want to paste some image data into the clipboard, the best would even be to avoid any auto-scaling and just use the data at 100%, so calling |
This PR adds suppression for deprecation warnings related to getImageDataAtCurrentZoom() in the ClipboardExample code.