enforce utf-8 encoding for casting QByteArray to str
remove print statements
This commit is contained in:
parent
18661cab0d
commit
27d94cae92
@ -48,7 +48,7 @@ class ImageExporter(Exporter):
|
|||||||
def export(self, fileName=None, toBytes=False, copy=False):
|
def export(self, fileName=None, toBytes=False, copy=False):
|
||||||
if fileName is None and not toBytes and not copy:
|
if fileName is None and not toBytes and not copy:
|
||||||
if QT_LIB in ['PySide', 'PySide2']:
|
if QT_LIB in ['PySide', 'PySide2']:
|
||||||
filter = ["*."+str(f) for f in QtGui.QImageWriter.supportedImageFormats()]
|
filter = ["*."+str(f, encoding='utf-8') for f in QtGui.QImageWriter.supportedImageFormats()]
|
||||||
else:
|
else:
|
||||||
filter = ["*."+bytes(f).decode('utf-8') for f in QtGui.QImageWriter.supportedImageFormats()]
|
filter = ["*."+bytes(f).decode('utf-8') for f in QtGui.QImageWriter.supportedImageFormats()]
|
||||||
preferred = ['*.png', '*.tif', '*.jpg']
|
preferred = ['*.png', '*.tif', '*.jpg']
|
||||||
@ -105,7 +105,7 @@ class ImageExporter(Exporter):
|
|||||||
elif toBytes:
|
elif toBytes:
|
||||||
return self.png
|
return self.png
|
||||||
else:
|
else:
|
||||||
self.png.save(fileName)
|
return self.png.save(fileName)
|
||||||
|
|
||||||
ImageExporter.register()
|
ImageExporter.register()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user