Skip to content

Commit

Permalink
book/util: replace sips with ImageMagick
Browse files Browse the repository at this point in the history
For some unknown reasons, pdflatex cannot read properly
the size of some png's. So the sips resizing is now made
with convert of imagemagick.
  • Loading branch information
sCreami committed Nov 21, 2015
1 parent d97f379 commit 692eaba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Vagrant.configure(2) do |config|
sudo apt-get update
sudo apt-get install -y dvipng \
graphviz \
imagemagick \
inkscape \
make \
mscgen \
Expand Down
3 changes: 2 additions & 1 deletion book/util/convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ if [ "${1##*.}" = "svg" ]; then
echo "Dimensions " ${W} "x" ${H}

if [ ${W} -gt 500 ]; then
${INKSCAPE} ${1} --export-width=500 --export-area-snap --export-area-drawing --export-png=${DIRNAME}/${BASENAME}.png
${INKSCAPE} ${1} --export-width=1000 --export-area-snap --export-area-drawing --export-png=${DIRNAME}/${BASENAME}.png
${INKSCAPE} ${1} --export-width=500 --export-area-snap --export-area-drawing --export-pdf=${DIRNAME}/${BASENAME}.pdf
convert ${DIRNAME}/${BASENAME}.png -resize '500' ${DIRNAME}/${BASENAME}.png
# sips --resampleWidth 500 ${DIRNAME}/${BASENAME}.png
# sips --resampleWidth 1000 ${DIRNAME}/${BASENAME}.pdf
else
Expand Down
3 changes: 2 additions & 1 deletion book/util/convertpkt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ if [ "${1##*.}" = "svg" ]; then
echo "Dimensions " ${W} "x" ${H}

if [ ${W} -gt 500 ]; then
${INKSCAPE} ${1} --export-width=500 --export-area-drawing --export-png=${DIRNAME}/${BASENAME}.png
${INKSCAPE} ${1} --export-width=1000 --export-area-drawing --export-png=${DIRNAME}/${BASENAME}.png
${INKSCAPE} ${1} --export-width=500 --export-area-drawing --export-pdf=${DIRNAME}/${BASENAME}.pdf
convert ${DIRNAME}/${BASENAME}.png -resize '500' ${DIRNAME}/${BASENAME}.png
# sips --resampleWidth 500 ${DIRNAME}/${BASENAME}.png
# sips --resampleWidth 1000 ${DIRNAME}/${BASENAME}.pdf
else
Expand Down

0 comments on commit 692eaba

Please sign in to comment.