#!/bin/bash iFile=$(<"$2") tempFile=$(mktemp) && { echo "${iFile:0:1600}" > "$tempFile" convert -size 210x290 -background white -pointsize 5 -border 10x10 -bordercolor "#CCC" caption:@"$tempFile" "$3" rm "$tempFile" }