image.pixels always returns nothing even when an image is loaded #90460

Closed
opened 2021-08-05 15:48:46 +02:00 by michael campbell · 17 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.92

Blender Version
Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-07-22 22:44, hash: fafd21b14c
Worked: (newest version of Blender that worked as expected)

Short description of error

open a new blend file
add an image
then in the console enter each line below (pressing enter in between):

pixels = bpy.data.images['image name'].pixels
image.channels
len(pixels)

they all return 0.

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 461.92 **Blender Version** Broken: version: 3.0.0 Alpha, branch: master, commit date: 2021-07-22 22:44, hash: `fafd21b14c` Worked: (newest version of Blender that worked as expected) **Short description of error** open a new blend file add an image then in the console enter each line below (pressing enter in between): ``` pixels = bpy.data.images['image name'].pixels image.channels len(pixels) ``` they all return 0.

Added subscriber: @3di

Added subscriber: @3di
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Is the Image loaded into some Editor?
Is image.has_data True or False?

If False, then #73761 (Images appended from disk do not have data) might be worth checking.

Is the Image loaded into some Editor? Is `image.has_data` True or False? If False, then #73761 (Images appended from disk do not have data) might be worth checking.

yes it's loaded into an image node in the compositor

yes it's loaded into an image node in the compositor

it's for a caching system I've almost finished. Just working on the bit that auto invalidates the cache if the downstream nodes output has changed.

I'm using the below as a workaround for now, but it's probably a bit slower than reading from the datablock directly:

the_path = file_system_helpers.get_absolute_path(val.filepath)
        with open(the_path,"rb") as f:
            the_bytes = f.read() # read entire file as bytes
            the_hash = hashlib.md5(the_bytes).hexdigest();
it's for a caching system I've almost finished. Just working on the bit that auto invalidates the cache if the downstream nodes output has changed. I'm using the below as a workaround for now, but it's probably a bit slower than reading from the datablock directly: ``` the_path = file_system_helpers.get_absolute_path(val.filepath) with open(the_path,"rb") as f: the_bytes = f.read() # read entire file as bytes the_hash = hashlib.md5(the_bytes).hexdigest();

oh yep, image does have data and it has_data returns True also.

oh yep, image does have data and it has_data returns True also.
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'

Closed as duplicate of #53768

Closed as duplicate of #53768

Added subscriber: @brecht

Added subscriber: @brecht

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

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

Wrong task..

Wrong task..

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

It's likely this is the same issue still, if the image you are testing with is a multilayer image.

Note this is why we ask for complete information and data to reproduce bugs, if you provided an example image file we'd find this immediately rather than guessing.

It's likely this is the same issue still, if the image you are testing with is a multilayer image. Note this is why we ask for complete information and data to reproduce bugs, if you provided an example image file we'd find this immediately rather than guessing.
Member

Changed status from 'Needs User Info' to: 'Archived'

Changed status from 'Needs User Info' to: 'Archived'
Member

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed.

Thanks again for the report. If the problem persists please open a new report with the required information.

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed. Thanks again for the report. If the problem persists please open a new report with the required information.
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#90460
No description provided.