From 416541c18545cabe0c1b25d698770d7a50a9136e Mon Sep 17 00:00:00 2001 From: Sam Wilkins Date: Fri, 24 Jan 2020 11:56:37 -0500 Subject: finalized image upload changes, fixed exif parsing, excessive image uploading and automatically encode native dimensions --- src/client/views/nodes/ImageBox.tsx | 42 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index b7e904283..c47e656fe 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -214,26 +214,26 @@ export class ImageBox extends DocAnnotatableComponent { - requestImageSize(imgPath) - .then((size: any) => { - const rotation = NumCast(this.dataDoc.rotation) % 180; - const realsize = rotation === 90 || rotation === 270 ? { height: size.width, width: size.height } : size; - const aspect = realsize.height / realsize.width; - if (this.Document.width && (Math.abs(1 - NumCast(this.Document.height) / NumCast(this.Document.width) / (realsize.height / realsize.width)) > 0.1)) { - setTimeout(action(() => { - if (this.paths[NumCast(this.props.Document.curPage)] === imgPath && (!this.layoutDoc.isTemplateDoc || this.dataDoc !== this.layoutDoc)) { - this._resized = imgPath; - this.Document.height = this.Document[WidthSym]() * aspect; - this.Document.nativeHeight = realsize.height; - this.Document.nativeWidth = realsize.width; - } - }), 0); - } else this._resized = imgPath; - }) - .catch((err: any) => console.log(err)); - } + // _resized = ""; + // resize = (imgPath: string) => { + // requestImageSize(imgPath) + // .then((size: any) => { + // const rotation = NumCast(this.dataDoc.rotation) % 180; + // const realsize = rotation === 90 || rotation === 270 ? { height: size.width, width: size.height } : size; + // const aspect = realsize.height / realsize.width; + // if (this.Document.width && (Math.abs(1 - NumCast(this.Document.height) / NumCast(this.Document.width) / (realsize.height / realsize.width)) > 0.1)) { + // setTimeout(action(() => { + // if (this.paths[NumCast(this.props.Document.curPage)] === imgPath && (!this.layoutDoc.isTemplateDoc || this.dataDoc !== this.layoutDoc)) { + // this._resized = imgPath; + // this.Document.height = this.Document[WidthSym]() * aspect; + // this.Document.nativeHeight = realsize.height; + // this.Document.nativeWidth = realsize.width; + // } + // }), 0); + // } else this._resized = imgPath; + // }) + // .catch((err: any) => console.log(err)); + // } @action onPointerEnter = () => { @@ -306,7 +306,7 @@ export class ImageBox extends DocAnnotatableComponent
-- cgit v1.2.3-70-g09d2