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
feat: add nativeImage.createThumbnailFromPath API #24802
Conversation
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.
This API does not belong to app
module, I believe it should be part of shell
or nativeImage
module (I prefer shell
a bit).
/cc @electron/wg-api for more inputs.
I think it fits with |
@georgexu99 has manually backported this PR to "10-x-y", please check out #25072 |
The @electron/wg-api approved this via Slack on Aug 20th, 2020 |
Release Notes Persisted
|
I tried to get app icon and got an error
Does this API only get thumbnails of images? |
@gaodeng I'm also trying to get app icons in a cross-platform, high-res way. Could you share whether nativeImage.createThumbnailFromPath worked out for you, or what your best approach was? |
@MentalGear Facts have proved that high-definition icons can only be obtained through native mode, and electron does not support it. |
Description of Change
This api returns a preview thumbnail of a file given its file path. The thumbnail is the same as a file's preview picture in explorer/finder.
Checklist
npm test
passesRelease Notes
Notes: Added app.createThumbnailFromPath() API that returns a preview image of a file given its file path and a maximum thumbnail size.