Page 1 of 1

Installing Pillow in Sabnzbd

Posted: November 10th, 2020, 12:54 pm
by Richard63NL
Hello, i have Python 2.7 installed on my system AND Sabnzbd (which uses Python 3.8)

All works fine, but i made a script wich needs Pillow (PIL) to find out if the cover i put in the incompleet film folder is landscape or portrait
When portrait mode its renamed folder.jpg else its fanart.jpg

the demo works (without sabnzbd on python 2.7) but on sabnzbd it says its not installed.

So how to install Pillow on to Sabnzbd folder ??

Regards Richard

Re: Installing Pillow in Sabnzbd

Posted: November 11th, 2020, 5:45 am
by safihre
What kind of operating system do you use?
Linux or Windows?
Both require a different solution :)

Re: Installing Pillow in Sabnzbd

Posted: November 11th, 2020, 11:11 am
by Richard63NL
I use windows 7 (ultimate)

Re: Installing Pillow in Sabnzbd

Posted: November 12th, 2020, 5:35 am
by safihre
Then you would probably need to use a .bat file in which you call python2 directly and pass all arguments to it that you get from SABnzbd.
For example
https://github.com/sabnzbd/sabnzbd/blob ... stProc.cmd
You can modify it to pass all the % variables to a new call.

Re: Installing Pillow in Sabnzbd

Posted: November 13th, 2020, 12:35 pm
by Richard63NL
This is the demo script wich works from python direct in a commandline

import os, sys
print (sys.path)

from PIL import Image, ExifTags

image=Image.open("www.nzbserver.jpg")
width, height = image.size
print (width, height)

if width > height:
print ("landscape")
else:
print ("portrait")

Re: Installing Pillow in Sabnzbd

Posted: November 18th, 2020, 4:35 am
by Richard63NL
Ok i use a bat file to execute python 3.7 from category's wich works.

First i thought that i have to get variables back to sabnzbd, butt i stay on the external python for the whole script.
Sab still gives the results back after running the script like it normal did.

So thanks for the push in the right direction :-) Safihre

Re: Installing Pillow in Sabnzbd

Posted: November 19th, 2020, 3:51 am
by safihre
Nice!
Maybe you can share the final script here?