diff --git a/src/tiny-image-editor/src/components/Upload.tsx b/src/tiny-image-editor/src/components/Upload.tsx index 13a6bb596d46daadab4d86de0942fe5c761f4b9f..1235b04fccfefa81dc2804b38dca26573d2d0cf3 100644 --- a/src/tiny-image-editor/src/components/Upload.tsx +++ b/src/tiny-image-editor/src/components/Upload.tsx @@ -136,6 +136,14 @@ export const useUpload = () => { const canvas = canvasInstanceRef.current; if(canvasEl?.current&&typeof e === 'string'){ let imgObj = new Image(); + + /** const newScaleFactor = Math.min(currentCanvasWidth / img.width, currentCanvasHeight / img.height); + img.set({ + left: 0, + top: 0, + scaleX: newScaleFactor, + scaleY: newScaleFactor + });**/ imgObj.src = e as string; initBackGroundImage(e as string, true, () => { historyRef.current.updateCanvasState(ACTION.add);