aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/Import & Export/ImageUtils.ts
diff options
context:
space:
mode:
authorJoanne <zehan_ding@brown.edu>2025-05-12 20:58:01 -0400
committerJoanne <zehan_ding@brown.edu>2025-05-12 20:58:01 -0400
commitcd93c88b8fee83a99342eac4dc60f7b4373fa843 (patch)
treeb00d1f46c802752c90e54bb21be785a05e05195e /src/client/util/Import & Export/ImageUtils.ts
parent4997c3de20a381eac30224a7a550afa66174f07d (diff)
parent3a733aa0fd24517e83649824dec0fc8bcc0bde43 (diff)
added tutorial tool, still need to integrate with metadatatool
Diffstat (limited to 'src/client/util/Import & Export/ImageUtils.ts')
-rw-r--r--src/client/util/Import & Export/ImageUtils.ts14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/client/util/Import & Export/ImageUtils.ts b/src/client/util/Import & Export/ImageUtils.ts
index 43807397f..eae3460b3 100644
--- a/src/client/util/Import & Export/ImageUtils.ts
+++ b/src/client/util/Import & Export/ImageUtils.ts
@@ -1,6 +1,5 @@
import { ClientUtils } from '../../../ClientUtils';
import { Doc } from '../../../fields/Doc';
-import { DocData } from '../../../fields/DocSymbols';
import { Id } from '../../../fields/FieldSymbols';
import { Cast, NumCast, StrCast } from '../../../fields/Types';
import { ImageField } from '../../../fields/URLField';
@@ -16,13 +15,12 @@ export namespace ImageUtils {
export const AssignImgInfo = (document: Doc, data?: Upload.InspectionResults) => {
if (data) {
data.nativeWidth && (document._height = (NumCast(document._width) * data.nativeHeight) / data.nativeWidth);
- const proto = document[DocData];
- const field = Doc.LayoutFieldKey(document);
- proto[`${field}_nativeWidth`] = data.nativeWidth;
- proto[`${field}_nativeHeight`] = data.nativeHeight;
- proto[`${field}_path`] = data.source;
- proto[`${field}_exif`] = JSON.stringify(data.exifData.data);
- proto[`${field}_contentSize`] = data.contentSize ? data.contentSize : undefined;
+ const field = '$' + Doc.LayoutDataKey(document);
+ document[`${field}_nativeWidth`] = data.nativeWidth;
+ document[`${field}_nativeHeight`] = data.nativeHeight;
+ document[`${field}_path`] = data.source;
+ document[`${field}_exif`] = JSON.stringify(data.exifData.data);
+ document[`${field}_contentSize`] = data.contentSize ? data.contentSize : undefined;
}
return document;
};