Crash using image resize operator with edit_image context override #97850
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#97850
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows 10
Blender Version
Broken: 2.91.0, 2.93.7, 3.0.0, 3.1.2
2.91.0 is the oldest version I have installed that has the image resize operator, I have not tested other versions in-between.
Short description of error
The
bpy.ops.image.resize
operator used withedit_image
context override crashes Blender.Expected behaviour
I would expect it to not crash Blender and that it would either:
or
Possible cause
I'm a little out of my depth reading the Blender source, but it appears to happen because the resize operator (called 'scale' in
image_ops.c
) requires aSpaceImage
(bpy.types.SpaceImageEditor
in the Python API) incontext.space_data
, but itspoll
function returnsTrue
whencontext.edit_image
is a valid image even ifcontext.space_data
is not a validSpaceImageEditor
.I'm guessing the poll function is currently shared between the image operators that require a
SpaceImage
and other image operators that do not require aSpaceImage
.Exact steps for others to reproduce the error
In the python console, run:
Or copy and paste into text editor and run:
Added subscriber: @Mysteryem-2
Added subscriber: @rjg
Changed status from 'Needs Triage' to: 'Confirmed'
The poll function could be modified, but
image_scale_exec
should definitely check ifsima
isNULL
and cancel the operation if that is the case. This is already done for determiningis_paint
, but obviously needs to be the case whenever the pointer is dereferenced.Overriding context changed a bit, so now you have to use
Using that, I am not getting a crash anymore (I also dont see
SpaceImage
being used anymore other than for theis_paint
check)@Mysteryem-2 : can you confirm the crash is fixed for you in fresh builds from https://builder.blender.org/download/daily/ ?
The crash is fixed as of Blender 3.3.0 (crash still occurred up to 3.2.0) and the context override appears to work as expected.
OKi, thx getting back!
Will close then.