diff options
author | bobzel <zzzman@gmail.com> | 2020-10-29 17:10:50 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-10-29 17:10:50 -0400 |
commit | 8929e23f8e01c9a040ccc51a5415e75e69dbf5ac (patch) | |
tree | e2aa275b78b38f8b42ba3ed57d967b58397239c1 /src | |
parent | 964965807a0f18ecf580b463a0c1d6f30efdde7b (diff) |
fixed images not having a height when imported
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/Import & Export/ImageUtils.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/util/Import & Export/ImageUtils.ts b/src/client/util/Import & Export/ImageUtils.ts index 0d12b39b8..9bd92a316 100644 --- a/src/client/util/Import & Export/ImageUtils.ts +++ b/src/client/util/Import & Export/ImageUtils.ts @@ -1,7 +1,6 @@ import { Doc } from "../../../fields/Doc"; import { ImageField } from "../../../fields/URLField"; -import { Cast, StrCast } from "../../../fields/Types"; -import { Docs } from "../../documents/Documents"; +import { Cast, StrCast, NumCast } from "../../../fields/Types"; import { Networking } from "../../Network"; import { Id } from "../../../fields/FieldSymbols"; import { Utils } from "../../../Utils"; @@ -22,6 +21,7 @@ export namespace ImageUtils { } = await Networking.PostToServer("/inspectImage", { source }); document.exif = error || Doc.Get.FromJson({ data }); const proto = Doc.GetProto(document); + nativeWidth && (document._height = NumCast(document._width) * nativeHeight / nativeWidth); proto["data-nativeWidth"] = nativeWidth; proto["data-nativeHeight"] = nativeHeight; proto["data-path"] = source; |