Skip to content

feat: add nativeImage.createThumbnailFromPath API - #24802

Merged
MarshallOfSound merged 25 commits into
electron:masterfrom
georgexu99:anewbranch
Aug 24, 2020
Merged

MarshallOfSound merged 25 commits into
electron:masterfrom
georgexu99:anewbranch

Conversation

@georgexu99

@georgexu99 georgexu99 commented Jul 31, 2020 •

Copy link
Copy Markdown
Contributor

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

Release Notes

Notes: Added app.createThumbnailFromPath() API that returns a preview image of a file given its file path and a maximum thumbnail size.

@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Jul 31, 2020
Comment thread shell/browser/browser_mac.mm Resolved
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Aug 1, 2020
@georgexu99 georgexu99 changed the title [WIP] feat: add app.createThumbnailFromPath API feat: add app.createThumbnailFromPath API Aug 6, 2020
George Xu added 2 commits August 6, 2020 21:39
@georgexu99
georgexu99 marked this pull request as ready for review August 7, 2020 18:03

@zcbenz zcbenz left a comment •

Copy link
Copy Markdown
Contributor

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.

@MarshallOfSound

Copy link
Copy Markdown
Member

I think it fits with nativeImage nicely (create from x). I think it was originally put in app because of app.getFileIcon which is kinda weird to be in app as well 🤷

@MarshallOfSound MarshallOfSound changed the title feat: add app.createThumbnailFromPath API feat: add nativeImage.createThumbnailFromPath API Aug 18, 2020
Comment thread lib/browser/init.ts Resolved
@trop

trop Bot commented Aug 20, 2020

Copy link
Copy Markdown
Contributor

@georgexu99 has manually backported this PR to "10-x-y", please check out #25072

@jkleinsc

Copy link
Copy Markdown
Member

The @electron/wg-api approved this via Slack on Aug 20th, 2020

@MarshallOfSound
MarshallOfSound merged commit beaf60d into electron:master Aug 24, 2020
@release-clerk

release-clerk Bot commented Aug 24, 2020

Copy link
Copy Markdown

Release Notes Persisted

Added app.createThumbnailFromPath() API that returns a preview image of a file given its file path and a maximum thumbnail size.

@gaodeng

gaodeng commented Nov 21, 2020

Copy link
Copy Markdown

I tried to get app icon and got an error

Error: unable to retrieve thumbnail preview image for the given path

Does this API only get thumbnails of images?
In that case, there doesn't seem to be much difference between this api and nativeImage.createFromPath(path) + resize

@MentalGear

MentalGear commented Jun 29, 2022 •

Copy link
Copy Markdown

@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?

@fanchenio

Copy link
Copy Markdown

@MentalGear Facts have proved that high-definition icons can only be obtained through native mode, and electron does not support it.

@georgexu99
georgexu99 deleted the anewbranch branch November 21, 2022 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants