u
This commit is contained in:
29
API.pic.md
29
API.pic.md
@@ -31,6 +31,35 @@ const image = await store.pic.getImageByHash(42, 'abc123');
|
||||
// => { buffer, w, h, size, contentType: 'image/avif' }
|
||||
```
|
||||
|
||||
## `pic.getSmallThumbByHash`
|
||||
|
||||
*Source: `src/store/pic/getSmallThumbByHash.js`*
|
||||
|
||||
Returns the small thumbnail image (AVIF, 40px max edge) for a given hash.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `fullHash` | `string` | The full image hash. |
|
||||
| `[tx]` | `object` | Optional transaction to run within. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<{buffer: Buffer, w: number, h: number, contentType: string}>` — The small thumbnail image.
|
||||
|
||||
**Throws**
|
||||
|
||||
`Error` — If the image is not found.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const thumb = await store.pic.getSmallThumbByHash(42, 'abc123');
|
||||
// => { buffer, w, h, contentType: 'image/avif' }
|
||||
```
|
||||
|
||||
## `pic.getThumbByHash`
|
||||
|
||||
*Source: `src/store/pic/getThumbByHash.js`*
|
||||
|
||||
Reference in New Issue
Block a user