I can't load big images

27 views
Skip to first unread message

Hugo Ruscitti

unread,
Jun 12, 2008, 4:34:41 PM6/12/08
to pyglet...@googlegroups.com
Hi, i have some problems when try to open a big png file. Using
the file:

http://www.losersjuegos.com.ar/incoming/descargas/20080612/sky.png


("file" command show: sky.png: PNG image data, 2144 x 480,
8-bit/color RGB, non-interlaced)

with this code:

--- %< ---
import pyglet

window = pyglet.window.Window()
img = pyglet.image.load('sky.png')
texture = img.get_texture()

# fail as well as:
# img = pyglet.resource.image('sky.png')
--- %< ---

i get:

--- %< ---
Traceback (most recent call last):
File "bug.py", line 6, in <module>
texture = img.get_texture()
File "/usr/lib/python2.5/site-packages/pyglet/image/__init__.py",
line 780, in get_texture
self._current_texture = self.create_texture(Texture, rectangle)
File "/usr/lib/python2.5/site-packages/pyglet/image/__init__.py",
line 768, in create_texture
texture = cls.create(self.width, self.height, internalformat, rectangle)
File "/usr/lib/python2.5/site-packages/pyglet/image/__init__.py",
line 1451, in create
blank)
File "/usr/lib/python2.5/site-packages/pyglet/gl/lib.py", line 105,
in errcheck
raise GLException(msg)
pyglet.gl.lib.GLException: invalid value
--- %< ---

Is a pyglet or hardware restriction?

thanks!.

--
Hugo Ruscitti
www.losersjuegos.com.ar

log.txt

Alex Holkner

unread,
Jun 12, 2008, 5:11:09 PM6/12/08
to pyglet...@googlegroups.com

Hardware. e.g., this works anywhere:

>>> import pyglet
>>> pyglet.image.load('sky.png')
<ImageData 2144x480>

On the laptop I'm working on at the moment, I get the same error as
you calling get_texture(). You can check the maximum texture size for
your device/driver with:

>>> from pyglet.gl import *
>>> v = GLint()
>>> glGetIntegerv(GL_MAX_TEXTURE_SIZE, v)
>>> v
c_long(2048)

Newer cards (GeForce 6 and later) support texture sizes of at least 4096, IIRC.

Alex.

zz

unread,
Jun 15, 2008, 4:51:50 PM6/15/08
to pyglet-users
Hi!, had same problem, try to update your card drivers :)

On 13 июн, 01:11, "Alex Holkner" <alex.holk...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages