From 1d3149450d8503cc13a59f827f830a765400af2f Mon Sep 17 00:00:00 2001 From: Stephen von Takach Date: Fri, 16 Feb 2024 20:15:59 +1100 Subject: [PATCH] chore(frame): add more information to error --- src/ffmpeg/frame.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ffmpeg/frame.cr b/src/ffmpeg/frame.cr index 7d76b64..a644b29 100644 --- a/src/ffmpeg/frame.cr +++ b/src/ffmpeg/frame.cr @@ -156,7 +156,7 @@ class FFmpeg::Frame bottom = bottom.clamp(0, max_y) left = left.clamp(0, max_x) right = right.clamp(0, max_x) - raise "crop is not valid: #{left},#{top} => #{right},#{bottom}" if (left + right) >= max_x || (top + bottom) >= max_y + raise "crop on #{max_x}x#{max_y} is not valid: #{left},#{top} => #{right},#{bottom}" if (left + right) >= max_x || (top + bottom) >= max_y return self if top.zero? && left.zero? && bottom.zero? && right.zero? unsafe_crop(top, left, bottom, right)