aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpixelterm/gifterm.py10
-rwxr-xr-xpixelterm/pixelterm.py2
2 files changed, 8 insertions, 4 deletions
diff --git a/pixelterm/gifterm.py b/pixelterm/gifterm.py
index 0ebded1..e3563f3 100755
--- a/pixelterm/gifterm.py
+++ b/pixelterm/gifterm.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
import os, sys, argparse, os.path, json, time, signal, atexit
-from pixelterm import pixelterm
+import pixelterm
from PIL import Image, GifImagePlugin, ImageSequence
clear_screen = '\033[H\033[2J'
@@ -18,7 +18,10 @@ def main():
if args.size:
tw, th = map(int, args.size.split('x'))
else:
- tw, th = os.get_terminal_size()
+ try:
+ tw, th = os.get_terminal_size()
+ except: # If this is not a regular terminal
+ pass
th = th*2
img = Image.open(args.image)
@@ -38,7 +41,8 @@ def main():
last_frame = c
im = last_frame.copy()
- im.thumbnail((tw, th), Image.NEAREST)
+ if (tw, th) != (None, None):
+ im.thumbnail((tw, th), Image.NEAREST)
frames.append(pixelterm.termify_pixels(im))
print(cursor_invisible)
diff --git a/pixelterm/pixelterm.py b/pixelterm/pixelterm.py
index dccd788..30af163 100755
--- a/pixelterm/pixelterm.py
+++ b/pixelterm/pixelterm.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-from pixelterm import xtermcolors
+import xtermcolors
reset_sequence = '\033[39;49m'