diff options
author | bobzel <zzzman@gmail.com> | 2024-06-21 11:37:58 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-06-21 11:37:58 -0400 |
commit | 50980b834cc41b8048d3e04c5244c6bce652f788 (patch) | |
tree | 8a64c9ec7f283dfc9d959caafadc2af145b8384e /src | |
parent | cf539fc086c27f53cec764202d3212a996113638 (diff) |
added renderedPixelDimensions to imageBox
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/request-image-size.ts | 1 | ||||
-rw-r--r-- | src/client/views/nodes/ImageBox.tsx | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/client/util/request-image-size.ts b/src/client/util/request-image-size.ts index 0f98a2710..48cb6e3a5 100644 --- a/src/client/util/request-image-size.ts +++ b/src/client/util/request-image-size.ts @@ -54,6 +54,7 @@ module.exports = function requestImageSize(options: any) { } } catch (err) { /* empty */ + console.log("Error: ", err) } }); diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index e4b3a1b9b..68c313480 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -448,6 +448,11 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { }; focus = (anchor: Doc, options: FocusViewOptions) => (anchor.type === DocumentType.CONFIG ? undefined : this._ffref.current?.focus(anchor, options)); + renderedPixelDimensions = async () => { + const { nativeWidth: width, nativeHeight: height } = await Networking.PostToServer('/inspectImage', { source: this.paths[0] }); + return { width, height }; + }; + savedAnnotations = () => this._savedAnnotations; render() { TraceMobx(); |