Page MenuHome

Preview or loading large image as texture crashes blender
Closed, ResolvedPublic

Description

When I load the a big image file as texture blender crashes. With reduced images (50%) it works fine. (trying to attach file after bug creation because this fails several times; the file is about 9MByte)
If I am not fast enough and the preview seems to be calculated blender crashes too.

My blender info:
Blender 2.54 (sub 0) Build
build date: 2010-09-11
build time: 16:36:04
build revision: <UNKNOWN>
build platform: Linux:32bit
build type: Release



output from blender -d

Blender 2.54 (sub 0) Build
Build: 2010-09-11 16:36:04 Linux:32bit Release
argv[0] = ./blender
argv[1] = -d
read file
Version 253 sub 1

ordered
OBCube
OBLamp
OBCamera
swin 1 added
swin 2 added
swin 3 added
swin 4 added
swin 5 added
swin 6 added
swin 7 added
swin 8 added
swin 9 added
swin 10 added
swin 11 added
swin 12 added
swin 13 added
set screen
found bundled python: /home/georg/blender/blender-2.54-beta-linux-glibc27-i686/2.54/python
SRNA Subclassed: 'Context'
time properties_animviz 0.0003
SRNA Subclassed: 'Panel'
time properties_data_armature 0.0019
SRNA Subclassed: 'IDPropertyGroup'
SRNA Subclassed: 'IDPropertyGroup'
SRNA Subclassed: 'Operator'
SRNA Subclassed: 'Menu'
SRNA Subclassed: 'Header'
time properties_data_armature_rigify 0.0035
time properties_data_bone 0.0009
time properties_data_camera 0.0005
time properties_data_curve 0.0010
time properties_data_empty 0.0002
time properties_data_lamp 0.0011
time properties_data_lattice 0.0004
time properties_data_mesh 0.0011
time properties_data_metaball 0.0005
time properties_data_modifier 0.0013

Event Timeline

G Fr (bl09gh) edited a custom field.Sep 15 2010, 6:30 PM

As uploading the original image does not work, You need to use the attached image and scale it up to 200%.

The same occurs under my 64Bit Linux

Blender runs out of memory trying to open this image. We currently don't have protections against such crashes in Blender, this is considered a todo item to tackle in the future, but not considered a bug currently.

Currently the biggest problem with this size of image is that it goes over 32768 limit for height or width (signed short). We could make a bit more room, so that it'd be good for larger than that (unsigned short would give 65535). So problem is here firstly that your image is to large sized for our data structures.

BUT

Loading this sized images will created huge problems already in Blender. The attached image, sized 200% gives a width of 34468 and a height of 2886. Internally that is going to allocate a memory buffer of 34468*2886*3*8 = 2387391552 bytes (2,2GB).

I leave this open for a while to confer with other devs to see what their opinion is and only then apply any fix.

Anyway, already thanks for reporting.

Right, didn't see Brecht already managed to reply, I was writing (slowly) while he also did :)

Anyway, I agree that handling memory errors is something that is for todo, although I think that 2.2GB is something that Blender (on 64bit) should be able to handle. MS Paint at least was able to open and save O.o

Ok, I would still consider this a todo item, but if you want to try to fix it, it may be related to int overflow with such large size, Campbell fixed such a problem for png's recently:
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31935

Ok, I would still consider this a todo item, but if you want to try to fix it, it may be related to int overflow with such large size, Campbell fixed such a problem for png's recently:
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31935

Quick fix doesn't seem to fully work - improvement is there, but a crash elsewhere needs to be figured out. Moving to our todo for long-term work on supporting large (in dimensions) images.

So until then, please make sure your images are not larger than 32768x32768.

Todo: http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Simple_Todos#Image.2FFile_sizes_supported_by_Blender

OK, I think using such a large file is not very important. But blender crashes too when the previews in the file browser are calculated! As some may have big files in the same directory with other images/textures they will be surprised if blender crashes with going into a directory.

Fixed by Campbell in r32171

Nathan Letwory (jesterking) changed the task status from Unknown Status to Resolved.Sep 28 2010, 12:06 PM