aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/Import & Export/ImageUtils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-02-19 15:05:47 -0500
committerbobzel <zzzman@gmail.com>2025-02-19 15:05:47 -0500
commitf6581aebd603dcdd84e033acffe46352ce5a4485 (patch)
tree63c5735a015f6ba7a0c302d0d81a66488de5ae04 /src/client/util/Import & Export/ImageUtils.ts
parentcf791104c0b1608e37c3cf2d25dac7f6f58a1b66 (diff)
more gptpopup cleanup.
Diffstat (limited to 'src/client/util/Import & Export/ImageUtils.ts')
-rw-r--r--src/client/util/Import & Export/ImageUtils.ts12
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];