[Interest] loading PPM {poof}

Waitman Gobble uzimac at da3m0n8t3r.com
Thu Jun 21 06:32:17 CEST 2012


Hi,

When I try to load a PPM into a QPixmap and display on my program dies.


I understand the following statement from the manual to imply that QImage and QPixmap support same image formats: "if no manipulation is desired, the image file can be loaded directly into a QPixmap". I also believe the documentation suggests that PPM files are supported by default.

an example ppm which kills my application:

# file /home/waitman/pv2012/2012-06-16/shootout/DCIM/100CANON/IMG_6651.ppm
/home/waitman/pv2012/2012-06-16/shootout/DCIM/100CANON/IMG_6651.ppm: Netpbm PPM "rawbits" image data

# identify /home/waitman/pv2012/2012-06-16/shootout/DCIM/100CANON/IMG_6651.ppm
/home/waitman/pv2012/2012-06-16/shootout/DCIM/100CANON/IMG_6651.ppm PPM 3465x5202 3465x5202+0+0 8-bit DirectClass 54.07MB 0.133u 0:00.632


code.

            path = model->filePath(index);
            qDebug() << path;
 
        QPixmap pm(path);
        statusBar()->showMessage(
        tr("puf (%1) ")
            .arg(pm.width()+","+pm.height()));

        gs->clear();
        gs->addPixmap(pm);
        gs->setSceneRect(pm.rect());
        gv->setScene(gs);
        gv->update();

message:
"/home/waitman/pv2012/2012-06-15/marina/DCIM/100CANON/ppm/IMG_6651.ppm" 
"" 
The program has unexpectedly finished.



Any ideas / suggestions appreciated.

Thanks,

-- 
Waitman Gobble
San Jose California USA


More information about the Interest mailing list