refactor: createThumbnailFromPath
takes size
not maxSize
(#37362)
refactor: createThumbnailFromPath takes size not maxSize
This commit is contained in:
parent
f33bf2a271
commit
8ee58e18fd
5 changed files with 72 additions and 12 deletions
|
@ -119,13 +119,15 @@ Returns `NativeImage`
|
|||
|
||||
Creates an empty `NativeImage` instance.
|
||||
|
||||
### `nativeImage.createThumbnailFromPath(path, maxSize)` _macOS_ _Windows_
|
||||
### `nativeImage.createThumbnailFromPath(path, size)` _macOS_ _Windows_
|
||||
|
||||
* `path` string - path to a file that we intend to construct a thumbnail out of.
|
||||
* `maxSize` [Size](structures/size.md) - the maximum width and height (positive numbers) the thumbnail returned can be. The Windows implementation will ignore `maxSize.height` and scale the height according to `maxSize.width`.
|
||||
* `size` [Size](structures/size.md) - the desired width and height (positive numbers) of the thumbnail.
|
||||
|
||||
Returns `Promise<NativeImage>` - fulfilled with the file's thumbnail preview image, which is a [NativeImage](native-image.md).
|
||||
|
||||
Note: The Windows implementation will ignore `size.height` and scale the height according to `size.width`.
|
||||
|
||||
### `nativeImage.createFromPath(path)`
|
||||
|
||||
* `path` string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue