add missing cropImageUtil file
This commit is contained in:
parent
beddddcb57
commit
bf7aee19b8
1 changed files with 13 additions and 0 deletions
13
src/view/com/modals/crop-image/cropImageUtil.ts
Normal file
13
src/view/com/modals/crop-image/cropImageUtil.ts
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
export const calculateDimensions = (
|
||||||
|
maxWidth: number,
|
||||||
|
originalHeight: number,
|
||||||
|
originalWidth: number,
|
||||||
|
) => {
|
||||||
|
const aspectRatio = originalWidth / originalHeight
|
||||||
|
const newHeight = maxWidth / aspectRatio
|
||||||
|
const newWidth = maxWidth
|
||||||
|
return {
|
||||||
|
width: newWidth,
|
||||||
|
height: newHeight,
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue