Error: Photoshop Error. Code: -1. When using `imaging.getPixels` in 16bit document

Version: Photoshop v26.3
Document: any 16bit document
Key parameter of imaging.getPixels: “componentSize: 8”

Most importantly, it does works in 25.0, but 26.3 does not.

1 Like

What is your code? Can you share that part?

try this one. open a 16bit psd then click button
works at 25.0 but will break in latest

And if you set component size to 16 instead 8?

Of course it will work.
The thing is, if the code worked in 25.0, but broke in the latest version. I have to confirm whether it was a breaking change or a bug.
I have already write own code to convert 16bit pixel data to 8bit pixel data.

If that worked before I believe it was a bug. Imagine you have 8bit document asking for 16bit. Where do you get those additional 50% of data from?