views:

48

answers:

1

Hello!

I'm programming a QGraphicsView that has a lot of images. But when I display a JPEG with resolution 8528 x 1128 px (a panorama image), the QGraphicsPixmapItem does not render. It just displays a black square. Images of "normal" size renders good. I have not tried to find the "magick limit" for what sizes the problem occures on.

On my laptop with Ubuntu 10.10 x64 it also chrashes the graphics card driver and restarts the Gnome session!

Everything works fine if I disable OpenGL.

Why? Are there anything I can do?

I've found another having a very similar problem: http://www.qtforum.org/article/34238/really-strange-problem-with-qgraphicsview-and-opengl.html

+3  A: 

Make sure this returns something greater than 8528 on your OpenGL implementation:

GLint texSize;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &texSize);

If it doesn't you're going to have to resort to some sort of tiled rendering system so you can fit all your image data in textures smaller than the maximum size.

genpfault
Just to reinforce this point - you're far exceeding the safe limits for a GL texture, as well as using a non-square, non-power-of-two dimension. All these factors reduce the hardware and GL drivers you're likely to work on. The good news is, since you're already using a QGraphicsView, splitting your huge image into pieces (on the CPU), and creating separate graphics items for each tile, should be easy.
James Turner