diff options
| author | bobzel <zzzman@gmail.com> | 2022-03-24 10:11:41 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-03-24 10:11:41 -0400 |
| commit | 0e965ed78222ffbb87489c40b32c7dbdf4cbe0d5 (patch) | |
| tree | 6f757ea55f93027255c3e8f30a38c09095b2915d /src/client/views/nodes/VideoBox.tsx | |
| parent | 6e61005b3b6dd8deeb3ca43a8c6241d7778a1998 (diff) | |
| parent | d21354fefc9f5b343e51c4db67e0bae7d0c187ee (diff) | |
fixed videobox upload data uri to have nosuffix parameter again.
Diffstat (limited to 'src/client/views/nodes/VideoBox.tsx')
| -rw-r--r-- | src/client/views/nodes/VideoBox.tsx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 804ba777e..02ef346fb 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -46,13 +46,21 @@ const path = require('path'); @observer export class VideoBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProps & FieldViewProps>() { public static LayoutString(fieldKey: string) { return FieldView.LayoutString(VideoBox, fieldKey); } - static async convertDataUri(imageUri: string, returnedFilename: string) { + /** + * Uploads an image buffer to the server and stores with specified filename. by default the image + * is stored at multiple resolutions each retrieved by using the filename appended with _o, _s, _m, _l (indicating original, small, medium, or large) + * @param imageUri the bytes of the image + * @param returnedFilename the base filename to store the image on the server + * @param nosuffix optionally suppress creating multiple resolution images + */ + public static async convertDataUri(imageUri: string, returnedFilename: string, nosuffix = false) { try { const posting = Utils.prepend("/uploadURI"); const returnedUri = await rp.post(posting, { body: { uri: imageUri, - name: returnedFilename + name: returnedFilename, + nosuffix }, json: true, }); |
