Compare commits
No commits in common. "1b89ba7e38173adc89d1a865df44f15389913333" and "f706a0265184e6c592992a671fc5b00a6ac9ca27" have entirely different histories.
1b89ba7e38
...
f706a02651
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,4 +2,3 @@ images
|
|||||||
logs
|
logs
|
||||||
synthesis
|
synthesis
|
||||||
*swp
|
*swp
|
||||||
stamps
|
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
IMG=$1
|
|
||||||
COUNT_HORIZONTAL=$2
|
|
||||||
COUNT_VERTICAL=$3
|
|
||||||
LANDSCAPE=${4}
|
|
||||||
|
|
||||||
panic(){ echo $@; exit 2; }
|
|
||||||
|
|
||||||
[[ ! -f $IMG ]] && panic "$IMG does not exist"
|
|
||||||
|
|
||||||
SMALL_SIDE=4000
|
|
||||||
LARGE_SIDE=5800
|
|
||||||
|
|
||||||
# /tmp/out.pdf PDF 567x822 567x822+0+0 16-bit sRGB 980KB 0.010u 0:00.009
|
|
||||||
read name type GEOMETRY canvas depth format size other <<< $( identify $IMG )
|
|
||||||
IMG_WIDTH=$( cut -d "x" -f 1 <<< $GEOMETRY )
|
|
||||||
IMG_HEIGHT=$( cut -d "x" -f 2 <<< $GEOMETRY )
|
|
||||||
|
|
||||||
TOTAL_WIDTH=$( [[ -n "$LANDSCAPE" ]] && echo $LARGE_SIDE || echo $SMALL_SIDE )
|
|
||||||
TOTAL_HEIGHT=$( [[ -n "$LANDSCAPE" ]] && echo $SMALL_SIDE || echo $LARGE_SIDE )
|
|
||||||
|
|
||||||
REQ_WIDTH=$(( $TOTAL_WIDTH / $COUNT_HORIZONTAL ))
|
|
||||||
REQ_HEIGHT=$(( $TOTAL_HEIGHT / $COUNT_VERTICAL ))
|
|
||||||
|
|
||||||
DUP=$(( ( $COUNT_HORIZONTAL * $COUNT_VERTICAL ) - 1 ))
|
|
||||||
|
|
||||||
DATE=$( date +%s )
|
|
||||||
OUTPUT_DIR=/tmp
|
|
||||||
FILENAME=$( basename $IMG )
|
|
||||||
PDF_NAME=${OUTPUT_DIR}/${DATE}_${FILENAME}.pdf
|
|
||||||
OUT=$( montage -tile ${COUNT_HORIZONTAL}x${COUNT_VERTICAL} -density 200x200 -units pixelspercentimeter -border 0 -page ${TOTAL_WIDTH}x${TOTAL_HEIGHT} "$IMG" -geometry ${REQ_WIDTH}x${REQ_HEIGHT} -duplicate ${DUP},0 ${PDF_NAME} )
|
|
||||||
|
|
||||||
[ 0 -eq $? ] && echo $PDF_NAME || panic "An error occured... $OUT"
|
|
Loading…
Reference in New Issue
Block a user