Skip to content

Commit e053559

Browse files
authored
Merge pull request #21 from djeada/feature/left-margin-safety
fix(make_short): shift content right with left padding instead of ove…
2 parents 396ec9e + 6dec46f commit e053559

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/make_short.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,12 @@ case "$FIT" in
236236
*) echo "Invalid --fit: $FIT"; exit 1 ;;
237237
esac
238238

239-
# Overlay left black margin on the final 1080x1920 frame without distorting content
239+
# Apply left safety margin without covering or cropping content:
240+
# - scale to fit within (1080 - SAFE_LEFT) x 1920 preserving AR
241+
# - then pad to 1080x1920 with left offset SAFE_LEFT and vertical centering
240242
if (( SAFE_LEFT > 0 )); then
241-
vf_chain+=("drawbox=x=0:y=0:w=${SAFE_LEFT}:h=ih:color=black:t=fill")
243+
vf_chain+=("scale=${TW}:1920:force_original_aspect_ratio=decrease:force_divisible_by=2")
244+
vf_chain+=("pad=1080:1920:${SAFE_LEFT}:floor((oh-ih)/2)")
242245
fi
243246

244247
# Pixel/Display aspect

0 commit comments

Comments
 (0)