Scan image via SSH

· 128 words · 1 minute read

We have an ancient Brother scan+print combination in our apartment. Cheap and reliable. Printing works well over CUPS, also from iPads with Airprint. My only issue was scanning. It works well with SANE, which also works via your network. Only problem is that the packages provided by Mattias Ellert on his website are a bit outdated and don’t always work with the latest Mac OSX. So here is a quick trick to scan on a remote machine without the trouble of moving the file later:

[cc lang=“bash” width=“100%” noborder=“1” theme=“dawn”] ssh cyrus@gaia.local “sudo scanimage –resolution 400 –format=tiff” | convert tiff:- -quality 90 -quiet `date “+%Y-%m-%d_%H-%M-%S”`.jpg  [/cc]

Basically this command pipes the image over SSH and hands it over to the local convert for compression. Neat and elegant. 🙂