so deep a rabbit hole
Posted: Sun Apr 29, 2018 8:08 pm
Ok, prefacing this here with the reminder that I'm not even to the level of script kiddie here. I'm hanging on to this with a thread.
I'm using curl to save an image to my Indigo public directory. That's working fine. But the native image is too big for the reflector or something. I get an Indigo error trying to display it.
So I've been trying various methods to resize the image automatically, and I'm now trying Python, which seems capable. Found this:
But when I try running this inside Indigo I get "No module named Image."
I DO have pillow installed, but it's installed via Python 2.7 apparently. Indigo uses 2.6, right?
I tried pip install pillow, but all I got was "requirement already satisfied."
Trying to follow instructions at https://stackoverflow.com/questions/553 ... on#5538353 got me more errors, and at that point I'm lost down this hole.
Alternately, if you think it's easier, I've also tried using ffmpeg inside a shell script to do this, but I keep running into trouble there too, as it appears that even though I try retrieving the image via curl then ffmpeg resizing, the shell script multi threads or something and ffmpeg is resizing the previous image before the curl retrieves the new image. And adding "sleep" commands didn't help.
I'm using curl to save an image to my Indigo public directory. That's working fine. But the native image is too big for the reflector or something. I get an Indigo error trying to display it.
So I've been trying various methods to resize the image automatically, and I'm now trying Python, which seems capable. Found this:
- Code: Select all
import Image, ImageFile
pic = "/Library/Application Support/Perceptive Automation/Indigo 7/IndigoWebServer/public/whatev.jpg"
im = Image.open(pic)
width, height = im.size
if width > 1200 or height > 1200:
width = width*.7
height = height*.7
im = im.resize((int(math.floor(width)), int(math.floor(height))), Image.ANTIALIAS)
try:
im.save(pic,optimize=True,quality=70)
except IOError:
ImageFile.MAXBLOCK = width * height
im.save(pic,optimize=True,quality=70)
But when I try running this inside Indigo I get "No module named Image."
I DO have pillow installed, but it's installed via Python 2.7 apparently. Indigo uses 2.6, right?
I tried pip install pillow, but all I got was "requirement already satisfied."
Trying to follow instructions at https://stackoverflow.com/questions/553 ... on#5538353 got me more errors, and at that point I'm lost down this hole.
Alternately, if you think it's easier, I've also tried using ffmpeg inside a shell script to do this, but I keep running into trouble there too, as it appears that even though I try retrieving the image via curl then ffmpeg resizing, the shell script multi threads or something and ffmpeg is resizing the previous image before the curl retrieves the new image. And adding "sleep" commands didn't help.