diff options
author | A.J. Shulman <Shulman.aj@gmail.com> | 2025-02-24 16:10:29 -0500 |
---|---|---|
committer | A.J. Shulman <Shulman.aj@gmail.com> | 2025-02-24 16:10:29 -0500 |
commit | 7b0bd66a0ad22b5a5cb17e76e811b59c6c7ca729 (patch) | |
tree | 7ee37b74c8ba511ac59160f9b11f251861faab1d /src/client/util/Import & Export/ImageUtils.ts | |
parent | a26c670b49a8631779869baf493135a59b92f523 (diff) | |
parent | 383a8a2f017c12c578537d3cb3005e00be019bd7 (diff) |
Merge branch 'master' into ajs-finalagent
Diffstat (limited to 'src/client/util/Import & Export/ImageUtils.ts')
-rw-r--r-- | src/client/util/Import & Export/ImageUtils.ts | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/client/util/Import & Export/ImageUtils.ts b/src/client/util/Import & Export/ImageUtils.ts index 8d4eefa7e..f73149fdc 100644 --- a/src/client/util/Import & Export/ImageUtils.ts +++ b/src/client/util/Import & Export/ImageUtils.ts @@ -4,22 +4,16 @@ import { DocData } from '../../../fields/DocSymbols'; import { Id } from '../../../fields/FieldSymbols'; import { Cast, NumCast, StrCast } from '../../../fields/Types'; import { ImageField } from '../../../fields/URLField'; +import { Upload } from '../../../server/SharedMediaTypes'; import { Networking } from '../../Network'; export namespace ImageUtils { - export type imgInfo = { - contentSize: number; - nativeWidth: number; - nativeHeight: number; - source: string; - exifData: { error: string | undefined; data: string }; - }; - export const ExtractImgInfo = async (document: Doc): Promise<imgInfo | undefined> => { + export const ExtractImgInfo = async (document: Doc): Promise<Upload.InspectionResults | undefined> => { const field = Cast(document.data, ImageField); return field ? Networking.PostToServer('/inspectImage', { source: field.url.href }) : undefined; }; - export const AssignImgInfo = (document: Doc, data?: imgInfo) => { + 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]; |