Use pnmcrop to crop the previews

Use pnmcrop to crop the previews and be done with all this nonsense.
Should fix the drawing problems in tables too.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5440 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-10-18 12:17:38 +00:00
parent 8648388992
commit 279ea68a2a
2 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2002-10-18 Angus Leeming <leeming@lyx.org>
* scripts/lyxpreview2bitmap.sh: Use pnmcrop to crop the images
if so desired.
2002-10-16 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* configure.m4: add mozilla as default previewer for html

View File

@ -196,3 +196,28 @@ fi
FILES=`ls ${BASE}* | sed -e "/${BASE}.metrics/d" \
-e "/${BASE}\([0-9]*\).${GSSUFFIX}/d"`
rm -f ${FILES} texput.log
# The bitmap files can have large amounts of whitespace to the left and
# right. This can be cropped if so desired.
CROP=1
which pnmcrop > /dev/null
if [ $? -ne 0 ]; then
CROP=0
fi
# There's no point cropping the image if using PNG images. If you want to
# crop, use PPM.
# Apparently dvipng will support cropping at some stage in the future...
if [ ${CROP} -eq 1 -a "${GSDEVICE}" = "pnmraw" ]; then
for FILE in ${BASE}*.${GSSUFFIX}
do
pnmcrop -left ${FILE} | pnmcrop -right ${FILE} > ${BASE}.tmp
if [ $? -eq 0 ]; then
mv ${BASE}.tmp ${FILE}
else
rm -f ${BASE}.tmp
fi
done
rm -f ${BASE}.tmp
fi