diff options
| author | Sam Wilkins <samwilkins333@gmail.com> | 2020-01-24 11:56:37 -0500 |
|---|---|---|
| committer | Sam Wilkins <samwilkins333@gmail.com> | 2020-01-24 11:56:37 -0500 |
| commit | 416541c18545cabe0c1b25d698770d7a50a9136e (patch) | |
| tree | c6b5a7cc1057799751b3acb0245094909cce161d /src/client/util/Import & Export/ImageUtils.ts | |
| parent | f984fab919c5c93937778103bbda47a058c57df2 (diff) | |
finalized image upload changes, fixed exif parsing, excessive image uploading and automatically encode native dimensions
Diffstat (limited to 'src/client/util/Import & Export/ImageUtils.ts')
| -rw-r--r-- | src/client/util/Import & Export/ImageUtils.ts | 12 |
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..2f4db0e17 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.nativeWidth = nativeWidth; + proto.nativeHeight = nativeHeight; + proto.contentSize = contentSize; return data !== undefined; }; |
