aboutsummaryrefslogtreecommitdiff
path: root/components/image.py
diff options
context:
space:
mode:
authortassaron2017-06-15 22:15:03 -0400
committertassaron2017-06-15 22:15:03 -0400
commitc05efc73ee069fe2eb8776a27b503ada2adb4af6 (patch)
tree33bb0fc36a3e6a730e51d52075d02814faebe40b /components/image.py
parent8603fa12e3d63705e3cbc202bd0635e5ac977225 (diff)
various bugfixes, blankFrame method for components
don't crash from broken project files or nonexistent videopaths, and shareable common paths in core.py
Diffstat (limited to 'components/image.py')
-rw-r--r--components/image.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/components/image.py b/components/image.py
index a2f0521..b6aa29b 100644
--- a/components/image.py
+++ b/components/image.py
@@ -38,6 +38,7 @@ class Component(__base__.Component):
super().update()
def previewRender(self, previewWorker):
+ self.imageFormats = previewWorker.core.imageFormats
width = int(previewWorker.core.settings.value('outputWidth'))
height = int(previewWorker.core.settings.value('outputHeight'))
return self.drawFrame(width, height)
@@ -52,7 +53,7 @@ class Component(__base__.Component):
return self.drawFrame(width, height)
def drawFrame(self, width, height):
- frame = Image.new("RGBA", (width, height), (0, 0, 0, 0))
+ frame = self.blankFrame(width, height)
if self.imagePath and os.path.exists(self.imagePath):
image = Image.open(self.imagePath)
if self.stretched and image.size != (width, height):
@@ -85,7 +86,8 @@ class Component(__base__.Component):
def pickImage(self):
imgDir = self.settings.value("backgroundDir", os.path.expanduser("~"))
filename = QtGui.QFileDialog.getOpenFileName(
- self.page, "Choose Image", imgDir, "Image Files (*.jpg *.png)")
+ self.page, "Choose Image", imgDir,
+ "Image Files (%s)" % " ".join(self.imageFormats))
if filename:
self.settings.setValue("backgroundDir", os.path.dirname(filename))
self.page.lineEdit_image.setText(filename)