aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/Import & Export/ImageUtils.ts
diff options
context:
space:
mode:
authorHannah <hannah_chow@brown.edu>2020-02-11 06:34:19 -0500
committerHannah <hannah_chow@brown.edu>2020-02-11 06:34:19 -0500
commitb60154479add51f826afaeff074cf43a6b416831 (patch)
tree723f7f1356b1c3dcf5c409347b125d5a577b538f /src/client/util/Import & Export/ImageUtils.ts
parent74ca8ac01e32faa8adab54ddfd806fe46cda03ec (diff)
parentdc6453e27375a1b3d614a74b7fd1d83695f130d7 (diff)
merge
Diffstat (limited to 'src/client/util/Import & Export/ImageUtils.ts')
-rw-r--r--src/client/util/Import & Export/ImageUtils.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/client/util/Import & Export/ImageUtils.ts b/src/client/util/Import & Export/ImageUtils.ts
index 6a9486f83..ff909cc6b 100644
--- a/src/client/util/Import & Export/ImageUtils.ts
+++ b/src/client/util/Import & Export/ImageUtils.ts
@@ -14,9 +14,17 @@ export namespace ImageUtils {
return false;
}
const source = field.url.href;
- const response = await Networking.PostToServer("/inspectImage", { source });
- const { error, data } = response.exifData;
+ const {
+ contentSize,
+ nativeWidth,
+ nativeHeight,
+ exifData: { error, data }
+ } = await Networking.PostToServer("/inspectImage", { source });
document.exif = error || Docs.Get.DocumentHierarchyFromJson(data);
+ const proto = Doc.GetProto(document);
+ proto["data-nativeWidth"] = nativeWidth;
+ proto["data-nativeHeight"] = nativeHeight;
+ proto.contentSize = contentSize;
return data !== undefined;
};