qgis / qgis-docker

Official Docker image for QGIS Server and Desktop
GNU Affero General Public License v3.0
74 stars 24 forks source link

add qt5-image-formats-plugins to support webp #45

Closed mbernasocchi closed 3 years ago

mbernasocchi commented 3 years ago

@daniviga do you think this would be cleaner directly in the qgis deb packages? if so can you point me to where I should do the change?

I tested within a container doing so:

from PyQt5 import QtGui

QtGui.QImageWriter.supportedImageFormats()
# without qt5-image-formats-plugins
#>>> [PyQt5.QtCore.QByteArray(b'bmp'), PyQt5.QtCore.QByteArray(b'cur'), PyQt5.QtCore.QByteArray(b'ico'), PyQt5.QtCore.QByteArray(b'jpeg'), PyQt5.QtCore.QByteArray(b'jpg'), PyQt5.QtCore.QByteArray(b'pbm'), PyQt5.QtCore.QByteArray(b'pgm'), PyQt5.QtCore.QByteArray(b'png'), PyQt5.QtCore.QByteArray(b'ppm'), PyQt5.QtCore.QByteArray(b'xbm'), PyQt5.QtCore.QByteArray(b'xpm')]

# with qt5-image-formats-plugins
#>>> [PyQt5.QtCore.QByteArray(b'bmp'), PyQt5.QtCore.QByteArray(b'cur'), PyQt5.QtCore.QByteArray(b'icns'), PyQt5.QtCore.QByteArray(b'ico'), PyQt5.QtCore.QByteArray(b'jpeg'), PyQt5.QtCore.QByteArray(b'jpg'), PyQt5.QtCore.QByteArray(b'pbm'), PyQt5.QtCore.QByteArray(b'pgm'), PyQt5.QtCore.QByteArray(b'png'), PyQt5.QtCore.QByteArray(b'ppm'), PyQt5.QtCore.QByteArray(b'tif'), PyQt5.QtCore.QByteArray(b'tiff'), PyQt5.QtCore.QByteArray(b'wbmp'), PyQt5.QtCore.QByteArray(b'webp'), PyQt5.QtCore.QByteArray(b'xbm'), PyQt5.QtCore.QByteArray(b'xpm')]
i = QtGui.QImage()
i.load('/io/data/test.png')
#>>> True
i.save('/io/data/res.webp')
#>>> True with qt5-image-formats-plugins, False without

please note that for webp to work correctly it requires also https://github.com/qgis/QGIS/pull/39762

mbernasocchi commented 3 years ago

@m-kuhn tells me that in fedora qt5-qtimageformats is already installed

mbernasocchi commented 3 years ago

fixed upstream https://github.com/qgis/QGIS/commit/71a755a023d65494328a882fbacfff7dad611158

daniviga commented 3 years ago

Yup, @mbernasocchi it should be fixed at the packaging level