diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/__base__.py | 2 | ||||
| -rw-r--r-- | src/components/text.py | 7 | ||||
| -rw-r--r-- | src/core.py | 26 | ||||
| -rw-r--r-- | src/main.py | 2 |
4 files changed, 24 insertions, 13 deletions
diff --git a/src/components/__base__.py b/src/components/__base__.py index 00601e7..b5e7d93 100644 --- a/src/components/__base__.py +++ b/src/components/__base__.py @@ -1,4 +1,4 @@ -from PyQt5 import uic, QtGui, QtCore, QtWidgets +from PyQt5 import uic, QtCore, QtWidgets from PIL import Image import os diff --git a/src/components/text.py b/src/components/text.py index 96421e6..6c5c4eb 100644 --- a/src/components/text.py +++ b/src/components/text.py @@ -3,7 +3,7 @@ from PyQt5.QtGui import QPainter, QColor, QFont from PyQt5 import QtGui, QtCore, QtWidgets from PIL.ImageQt import ImageQt import os -import io +import sys from . import __base__ @@ -136,7 +136,10 @@ class Component(__base__.Component): painter = QPainter(image) self.titleFont.setPixelSize(self.fontSize) painter.setFont(self.titleFont) - painter.setPen(QColor(*self.textColor[::-1])) + if sys.byteorder == 'big': + painter.setPen(QColor(*self.textColor)) + else: + painter.setPen(QColor(*self.textColor[::-1])) painter.drawText(x, y, self.title) painter.end() diff --git a/src/core.py b/src/core.py index b3c5640..3fa67db 100644 --- a/src/core.py +++ b/src/core.py @@ -17,7 +17,6 @@ import string class Core(): def __init__(self): - self.FFMPEG_BIN = self.findFfmpeg() self.dataDir = QStandardPaths.writableLocation( QStandardPaths.AppConfigLocation ) @@ -63,6 +62,7 @@ class Core(): '*.xpm', ]) + self.FFMPEG_BIN = self.findFfmpeg() self.findComponents() self.selectedComponents = [] # copies of named presets to detect modification @@ -437,15 +437,23 @@ class Core(): self.encoder_options = json.load(json_file) def findFfmpeg(self): - if sys.platform == "win32": - return "ffmpeg.exe" + if getattr(sys, 'frozen', False): + # The application is frozen + if sys.platform == "win32": + return os.path.join(self.wd, 'ffmpeg.exe') + else: + return os.path.join(self.wd, 'ffmpeg') + else: - try: - with open(os.devnull, "w") as f: - sp.check_call(['ffmpeg', '-version'], stdout=f, stderr=f) - return "ffmpeg" - except: - return "avconv" + if sys.platform == "win32": + return "ffmpeg.exe" + else: + try: + with open(os.devnull, "w") as f: + sp.check_call(['ffmpeg', '-version'], stdout=f, stderr=f) + return "ffmpeg" + except: + return "avconv" def readAudioFile(self, filename, parent): command = [self.FFMPEG_BIN, '-i', filename] diff --git a/src/main.py b/src/main.py index fd32b13..bae9adf 100644 --- a/src/main.py +++ b/src/main.py @@ -1,4 +1,4 @@ -from PyQt5 import QtGui, uic, QtWidgets +from PyQt5 import uic, QtWidgets import sys import os |
