mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-05-19 03:58:06 -04:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user