diff --git a/src/ks-crop b/src/ks-crop index a46ce5c..d18b550 100755 --- a/src/ks-crop +++ b/src/ks-crop @@ -116,6 +116,17 @@ function show_menu() { exit } +# Function to show error reading file +# Syntax: errorReadingFile +function errorReadingFile() { + echo "" + echo "* ks-crop (ks-tools) v${VERSION} (${M_DATE})" + echo "" + echo "* The file '${1}' does not exist!" + echo "" + exit +} + # Conversion parameters p_ffmpeg="ffmpeg -i" p_ffmpeg_patched="-max_muxing_queue_size 9999" @@ -149,6 +160,11 @@ elif [ "${1}" == "-5:4-aspect" ] ; then else show_menu fi +if [ -f "${2}" ] ; then + echo "detected" > /dev/null +else + errorReadingFile "${2}" +fi # Detect resolution of video file detect_2=$(ffmpeg -i ${2} 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d "," -f 2 | cut -d "[" -f 1 | tr -s " " | grep x) @@ -664,51 +680,13 @@ function crop_video() { # Syntax: ks-crop