Skip to content

🎥 Make videos programmatically with React

Update ConvertUi.tsx

JonnyBurger028484d0277f
diff --git a/packages/convert/app/components/ConvertUi.tsx b/packages/convert/app/components/ConvertUi.tsx
index 7651696ff8..31b6726ba5 100644
--- a/packages/convert/app/components/ConvertUi.tsx
+++ b/packages/convert/app/components/ConvertUi.tsx
@@ -297,7 +297,18 @@ const ConvertUI = ({
videoFrames++;
return flipped;
},
- crop: crop ? cropRect : undefined,
+ crop: crop
+ ? {
+ width: Number.isFinite(cropRect.width)
+ ? cropRect.width
+ : dimensions!.width - cropRect.left,
+ height: Number.isFinite(cropRect.height)
+ ? cropRect.height
+ : dimensions!.height - cropRect.top,
+ left: cropRect.left,
+ top: cropRect.top,
+ }
+ : undefined,
rotate: userRotation as Rotation,
forceTranscode: true,
...calculateMediabunnyResizeOption(