Regression: rescaling Image by python does not update image shown in image editor properly #98573

Closed
opened 2022-06-03 12:04:57 +02:00 by takaaki takeda · 9 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86

Blender Version
Broken: version: 3.2.0 Release Candidate, branch: master, commit date: 2022-06-02 15:53, hash: 2d9c5f3dcf
Worked: 3.0

NOTE: Notifying the Image Editor was always missing, but the "cropping" is a regression

Short description of error
Rescaling image by python does not update image shown in image editor properly.
For example, when a image "Untitled" with size 1024x1024 is shown in editor,
bpy.data.images['Untitled'].scale(256,256)
makes image size to be 256x256.
Image shown in the editor looks like a image which is "trimmed" to 256x256.
However, if you save that image, the image is "rescaled" image to 256x256.

I uploaded screenshot image here.
BugReport_ImageRescale.png
A "trimmed" image is shown in image editor.
But a image file saved is 256x256 "rescaled" image.

I noticed that blender 3.0 worked well.
The image in the image editor becomes 256x256 "rescaled" image.
After 3.1, the image in the image editor looks strange after rescaling by python.

Exact steps for others to reproduce the error

  1. Open Image Editor Panel and Python Console
  2. Make a new Image. For example, 1024x1024 Color Grid Image (named "Untitled").
  3. Execute bpy.data.images['Untitled'].scale(256,256) from python console
  4. At this moment, image editor is not refreshed. Move view or do something in image editor to refresh the image.
  5. A image in the editor looks like a trimmed image to 256x256.
  6. Save the image. The saved image is 256x256 rescaled image.
  7. If you change the image property like Color Space or Alpha, the image shown in editor becomes rescaled image.

(So I guess that the data itself is rescaled properly, but the buffer in image editor is strange)

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86 **Blender Version** Broken: version: 3.2.0 Release Candidate, branch: master, commit date: 2022-06-02 15:53, hash: `2d9c5f3dcf` Worked: 3.0 NOTE: Notifying the Image Editor was always missing, but the "cropping" is a regression **Short description of error** Rescaling image by python does not update image shown in image editor properly. For example, when a image "Untitled" with size 1024x1024 is shown in editor, bpy.data.images['Untitled'].scale(256,256) makes image size to be 256x256. Image shown in the editor looks like a image which is "trimmed" to 256x256. However, if you save that image, the image is "rescaled" image to 256x256. I uploaded screenshot image here. ![BugReport_ImageRescale.png](https://archive.blender.org/developer/F13130458/BugReport_ImageRescale.png) A "trimmed" image is shown in image editor. But a image file saved is 256x256 "rescaled" image. I noticed that blender 3.0 worked well. The image in the image editor becomes 256x256 "rescaled" image. After 3.1, the image in the image editor looks strange after rescaling by python. **Exact steps for others to reproduce the error** 1. Open Image Editor Panel and Python Console 2. Make a new Image. For example, 1024x1024 Color Grid Image (named "Untitled"). 3. Execute bpy.data.images['Untitled'].scale(256,256) from python console 4. At this moment, image editor is not refreshed. Move view or do something in image editor to refresh the image. 5. A image in the editor looks like a trimmed image to 256x256. 6. Save the image. The saved image is 256x256 rescaled image. 7. If you change the image property like Color Space or Alpha, the image shown in editor becomes rescaled image. (So I guess that the data itself is rescaled properly, but the buffer in image editor is strange)
Author

Added subscriber: @popqjp

Added subscriber: @popqjp
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can confirm, will check

Can confirm, will check
Philipp Oeser self-assigned this 2022-06-03 12:38:57 +02:00

This issue was referenced by cf6c8ae01b

This issue was referenced by cf6c8ae01b66a6260604e35c9c2d63bb06805e4f
Member

Notifying the Image Editor was always missing, but the "cropping" is a regression, so will mark as High priority.

Notifying the Image Editor was always missing, but the "cropping" is a regression, so will mark as High priority.
Philipp Oeser changed title from Rescaling Image by python does not update image shown in image editor properly to Regression: rescaling Image by python does not update image shown in image editor properly 2022-06-03 12:53:54 +02:00

Added subscriber: @mod_moder

Added subscriber: @mod_moder

2022-06-03 13-53-57.mp4
I checked this issue and also noticed that image resizing might not show up properly on the texture.

[2022-06-03 13-53-57.mp4](https://archive.blender.org/developer/F13130502/2022-06-03_13-53-57.mp4) I checked this issue and also noticed that image resizing might not show up properly on the texture.
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
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
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#98573
No description provided.