diff options
| author | bobzel <zzzman@gmail.com> | 2025-03-24 16:29:32 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2025-03-24 16:29:32 -0400 |
| commit | 858f5d2f1621695a703b0e3f8297521c3ebe692d (patch) | |
| tree | 3180f91ee18bf8accef98cbbb6db6688666e8340 /src/client/util/Import & Export/ImageUtils.ts | |
| parent | 9c5d14fdd562dc1bcc8aa0f73ce7ad189c9fbf23 (diff) | |
| parent | b6cf21b5a52184f89909898d292a79c57c043d7e (diff) | |
Merge branch 'fieldSyntaxUpdate' into aarav_edit
Diffstat (limited to 'src/client/util/Import & Export/ImageUtils.ts')
| -rw-r--r-- | src/client/util/Import & Export/ImageUtils.ts | 14 |
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..9c32ca25a 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.LayoutFieldKey(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; }; |
