forked from openlp/openlp
fixed ratio
This commit is contained in:
parent
47936e34a7
commit
e08c65aa45
@ -403,8 +403,8 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
ext = os.path.splitext(thumb_path)[1].lower()
|
ext = os.path.splitext(thumb_path)[1].lower()
|
||||||
reader = QtGui.QImageReader(image_path)
|
reader = QtGui.QImageReader(image_path)
|
||||||
reader.setScaledSize(QtCore.QSize(
|
ratio = float(reader.size().width()) / float(reader.size().height())
|
||||||
reader.size().width() / reader.size().height() * 88, 88))
|
reader.setScaledSize(QtCore.QSize(int(ratio * 88), 88))
|
||||||
thumb = reader.read()
|
thumb = reader.read()
|
||||||
thumb.save(thumb_path, ext[1:])
|
thumb.save(thumb_path, ext[1:])
|
||||||
return build_icon(unicode(thumb_path))
|
return build_icon(unicode(thumb_path))
|
||||||
|
Loading…
Reference in New Issue
Block a user