How to display multi page TIFF with PyQt

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to display multi page TIFF with PyQt

starglider.dev
I need to display a multi page tiff file with PyQt  
from the search in the internet they say that Qt doesn't support  
multi page TIFF.  
My code only shows the first page:  

    #!/usr/bin/python
    # -*- coding: utf-8 -*-
    import os
    import sys
    from PyQt4.QtGui import *
    
    class Dialog(QDialog):
        def __init__(self,  parent = None):
            super(Dialog,  self).__init__(parent)
            self.resize(1280, 1024)
            masterLayout = QHBoxLayout(self)
            mainLayout = QVBoxLayout()
            self.pictureLabel = QLabel()
            mainLayout.addWidget(self.pictureLabel)
            self.status_Label = QLabel('100')
            masterLayout.addLayout(mainLayout)      
            self.img_refresh()
    
        def img_refresh(self):
            imagem = QPixmap('image.tif')
            myScaledPixmap = imagem.scaled(1280,1024)
            self.pictureLabel.setPixmap(myScaledPixmap)
            self.setWindowTitle('test')
    
    def main():
        app = QApplication(sys.argv)
        form = Dialog()
        form.show()
        app.exec_()
    
    if __name__ == '__main__':
        main()


Thank you in advance.

_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
Reply | Threaded
Open this post in threaded view
|

Re: How to display multi page TIFF with PyQt

michael h


On Thu, Dec 10, 2015 at 4:41 PM, Starglider Developer <[hidden email]> wrote:
I need to display a multi page tiff file with PyQt  
from the search in the internet they say that Qt doesn't support  
multi page TIFF.  
My code only shows the first page:  


If as you say, Qt doesn't support it, you can use Pillow which supports multipage tiff:


There are some included utilities for interop with Qt as well:



- mike


_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt