From c6cc098e4743d74ba28a9abe9ef8aeb45e7d87c4 Mon Sep 17 00:00:00 2001 From: fritz-hh Date: Mon, 6 Jan 2014 23:08:35 +0100 Subject: [PATCH] create symbolic links and not copy If deskew and/or cleanup is not requested, do not copy the files, but just create symbolic link. This saves disk place and makes the script slightly quicker --- src/ocrPage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ocrPage.sh b/src/ocrPage.sh index b2dfed52..df083ac9 100644 --- a/src/ocrPage.sh +++ b/src/ocrPage.sh @@ -161,7 +161,7 @@ if [ "$PREPROCESS_DESKEW" -eq "1" ]; then ! convert "$curImgPixmap" -deskew 40% -gravity center -extent ${widthCurImg}x${heightCurImg} "$curImgPixmapDeskewed" \ && echo "Could not deskew \"$curImgPixmap\". Exiting..." && exit $EXIT_OTHER_ERROR else - cp "$curImgPixmap" "$curImgPixmapDeskewed" + ln -s `basename "$curImgPixmap"` "$curImgPixmapDeskewed" fi # if requested clean image with unpaper to get better OCR results @@ -172,7 +172,7 @@ if [ "$PREPROCESS_CLEAN" -eq "1" ]; then "$curImgPixmapDeskewed" "$curImgPixmapClean" 1> /dev/null \ && echo "Could not clean \"$curImgPixmapDeskewed\". Exiting..." && exit $EXIT_OTHER_ERROR else - cp "$curImgPixmapDeskewed" "$curImgPixmapClean" + ln -s `basename "$curImgPixmapDeskewed"` "$curImgPixmapClean" fi # perform OCR