View Single Post
Old 06-08-2022, 02:51 AM   #10
xyclonei
Zealot
xyclonei put the bomp in the bomp-a-bomp-a-bomp.xyclonei put the bomp in the bomp-a-bomp-a-bomp.xyclonei put the bomp in the bomp-a-bomp-a-bomp.xyclonei put the bomp in the bomp-a-bomp-a-bomp.xyclonei put the bomp in the bomp-a-bomp-a-bomp.xyclonei put the bomp in the bomp-a-bomp-a-bomp.xyclonei put the bomp in the bomp-a-bomp-a-bomp.xyclonei put the bomp in the bomp-a-bomp-a-bomp.xyclonei put the bomp in the bomp-a-bomp-a-bomp.xyclonei put the bomp in the bomp-a-bomp-a-bomp.xyclonei put the bomp in the bomp-a-bomp-a-bomp.
 
xyclonei's Avatar
 
Posts: 118
Karma: 67444
Join Date: Dec 2018
Device: Kobo Clara HD
Thank you, @NiLuJe! That's the fringe case example I was thinking of.

@qkqw, will adding -limit time 60 to the variables CONVERT & IDENTIFY work?

Code:
#!/bin/sh

ARTICLES="/mnt/onboard/.kobo/articles"
CONVERT="/mnt/onboard/.adds/pocket/convert -limit time 60"
IDENTIFY="/mnt/onboard/.adds/pocket/identify -quiet -limit time 60"

LD_LIBRARY_PATH="/mnt/onboard/.adds/pocket/lib:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH

for i in $(find $ARTICLES -type f -not -iname "*.html"); do
  FORMAT=$($IDENTIFY -format "%m" "$i")
  if [ "$FORMAT" == "PNG" ]; then
    $CONVERT "$i" "$i.jpg"
    mv "$i.jpg" "${i%.jpg}"
  fi
done
xyclonei is offline   Reply With Quote