UXP API Issue: layer.pixelMap and layer.type are Undefined for Pixel Layers in Photoshop Stable 26.7
Hello Adobe Team and Community,
I am developing a UXP plugin for Photoshop and have encountered a critical issue where I cannot access pixel data from layers. This issue is occurring in both Photoshop Stable version 26.7.0 and Photoshop Beta version 26.8.0.
Problem Description:
For any standard pixel layer (including newly created documents with a single painted layer), the UXP API reports:
layer.type as undefined.
layer.pixelMap as undefined.
This prevents my plugin from using layer.pixelMap.read() to access pixel data, which is essential for its functionality (a waveform monitor). Consequently, my plugin's panel menu item ("ColorScope Panel") is grayed out and unclickable in Photoshop's "Plugins" menu in both versions.
Steps to Reproduce (in both Photoshop 26.7.0 and Beta 26.8.0):
Create a UXP plugin with the manifest.json provided below.
Use JavaScript code within the plugin (relevant waveform.js snippet also below) to attempt to access layer details and pixel data.
In Photoshop: a. Create a new document (e.g., default Photoshop size). b. Create a new layer. c. Paint on this new layer with the brush tool. d. Ensure this painted layer is selected, visible, and unlocked.
Load the plugin and use the UXP Developer Tools to "Reload" and then "Debug" the plugin.
Observe the plugin's console output.
Observed Behavior (Console Log Output):
The following console log output is consistently produced when the plugin attempts to access a newly created, painted, and selected pixel layer (e.g., "Layer 1" in a new document "Untitled-1"):
JavaScript
Main.js: DOMContentLoaded fired.
Main.js: Attempting to draw waveform...
Waveform.js: drawWaveform function started.
Waveform.js: Canvas element #waveform found: e.exports
Waveform.js: Photoshop app module loaded.
Waveform.js: Active document found: Untitled-1
Waveform.js: Active layer found. Name: Layer 1 ID: 2
Waveform.js: Layer details - type: undefined kind: pixel visible: true locked: false
Waveform.js: layer.pixelMap is undefined or not readable. Type: undefined Kind: pixel
// ... (drawWaveform function then returns, and colorwheel drawing proceeds)
Expected Behavior:
layer.type should be "pixelLayer".
layer.pixelMap should be an object, allowing layer.pixelMap.read() to be called to retrieve pixel data.
The plugin's panel menu item should not be grayed out if the plugin can initialize correctly.
Impact:
This issue prevents the core functionality of my plugin.
It causes the plugin to be disabled in the Photoshop UI (grayed-out menu item).
This affects both the current stable release (26.7.0) and the current Beta (26.8.0).
System Information:
Operating System: Windows 11
Photoshop Versions Tested:
Photoshop Stable Release 26.7.0
Photoshop Beta Release 26.8.0
Manifest.json Content:
JSON
{
"manifestVersion": 5,
"id": "com.yourname.colorscope",
"name": "ColorScope Panel",
"version": "1.0.0",
"main": "index.html",
"host": {
"app": "PS",
"minVersion": "24.0.0"
},
"ui": {
"type": "panel",
"menuLabel": "ColorScope"
},
"permissions": {
"require": ["document", "layer", "pixelData"]
}
}
Relevant waveform.js Snippet (Illustrating the Check):
JavaScript
// ... inside async function drawWaveform() after getting 'layer' object ...
console.log("Waveform.js: Active layer found. Name:", layer.name, "ID:", layer.id);
console.log("Waveform.js: Layer details - type:", layer.type, "kind:", layer.kind, "visible:", layer.visible, "locked:", layer.locked);
// CRITICAL CHECK for pixelMap
if (typeof layer.pixelMap === 'undefined' || !layer.pixelMap.read) {
console.error("Waveform.js: layer.pixelMap is undefined or not readable. Type:", layer.type, "Kind:", layer.kind);
// Code to display message in panel UI would be here:
// if (messageElement) messageElement.textContent = "Waveform Error: Pixel data is unavailable...";
return;
}
// ... rest of code attempts layer.pixelMap.read() ...
Additional Notes:
The UXP Developer Tools main window shows the plugin in a "Watching" state.
The UXP Developer Tools logs report "Load command successful," "Reload command successful," etc., for the plugin. However, the panel remains grayed out in Photoshop's menu.
The issue persists even after trying to duplicate the layer; the duplicated layer also shows layer.type as undefined and layer.pixelMap as undefined.
Please let me know if any further information or testing is required from my end. This issue is a significant blocker for my UXP plugin development.
Thank you.
