Skip to content

Commit ff8f9c9

Browse files
authored
Merge branch 'master' into master
2 parents b4a2120 + a7606df commit ff8f9c9

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

pdf2remarkable.sh

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
# * Beyond core utilities (date, basename,...), the following software
5858
# has to be installed on the host computer:
5959
# - uuidgen
60-
# - imagemagick (or graphicsmagick)
6160

6261
# This is where ssh will try to copy the files associated with the document
6362
REMARKABLE_HOST=${REMARKABLE_HOST:-remarkable}
@@ -151,21 +150,6 @@ EOF
151150
# Add thumbnails directory
152151
mkdir ${tmpdir}/${uuid}.thumbnails
153152

154-
# Generate preview thumbnail for the first page
155-
# Different sizes were found (possibly depending on whether created by
156-
# the reMarkable itself or some synchronization app?): 280x374 or
157-
# 362x512 pixels. In any case the thumbnails appear to be baseline
158-
# jpeg images - JFIF standard 1.01, resolution (DPI), density 228x228
159-
# or 72x72, segment length 16, precision 8, frames 3
160-
#
161-
# The following will look nice only for PDFs that are higher than about 32mm.
162-
convert -density 300 "$filename"'[0]' \
163-
-colorspace Gray \
164-
-separate -average \
165-
-shave 5%x5% \
166-
-resize 280x374 \
167-
${tmpdir}/${uuid}.thumbnails/0.jpg
168-
169153
elif [ "$extension" == "epub" ]; then
170154

171155
# Add content information
@@ -175,8 +159,9 @@ EOF
175159
}
176160
EOF
177161
else
178-
echo "Unknown extension: $extension"
179-
exit
162+
echo "Unknown extension: $extension, skipping $filename"
163+
rm -rf ${tmpdir}/*
164+
continue
180165
fi
181166

182167
# Transfer files

0 commit comments

Comments
 (0)