mirror of
https://github.com/rbreu/beeref.git
synced 2026-03-11 08:54:28 +00:00
Finetuning JPG embedding options
This commit is contained in:
parent
723bb5819d
commit
485e946d45
2 changed files with 3 additions and 3 deletions
|
|
@ -65,6 +65,6 @@ class SceneToPixmapExporter:
|
|||
def export(self, filename, size):
|
||||
logger.debug(f'Exporting scene to {filename}')
|
||||
image = self.render_to_image(size)
|
||||
if not image.save(filename):
|
||||
if not image.save(filename, quality=90):
|
||||
raise BeeFileIOError(
|
||||
msg=str('Error writing image'), filename=filename)
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class BeePixmapItem(BeeItemMixin, QtWidgets.QGraphicsPixmapItem):
|
|||
if formt == 'best':
|
||||
# Images with alpha channel and small images are stored as png
|
||||
if (img.hasAlphaChannel()
|
||||
or (img.height() < 300 and img.width() < 300)):
|
||||
or (img.height() < 500 and img.width() < 500)):
|
||||
formt = 'png'
|
||||
else:
|
||||
formt = 'jpg'
|
||||
|
|
@ -156,7 +156,7 @@ class BeePixmapItem(BeeItemMixin, QtWidgets.QGraphicsPixmapItem):
|
|||
buffer.open(QtCore.QIODevice.OpenModeFlag.WriteOnly)
|
||||
img = self.pixmap().toImage()
|
||||
imgformat = self.get_imgformat(img)
|
||||
img.save(buffer, imgformat.upper())
|
||||
img.save(buffer, imgformat.upper(), quality=90)
|
||||
return (barray.data(), imgformat)
|
||||
|
||||
def setPixmap(self, pixmap):
|
||||
|
|
|
|||
Loading…
Reference in a new issue