EmilDohne / PhotoshopAPI

A modern and performant C++20 read/write parser of Photoshop Files (*.psd and *.psb) with fully fledged Python bindings hosted on PyPi
https://photoshopapi.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
94 stars 9 forks source link

[Python] Give more accurate errors when creating a layer with an incorrect shape #73

Closed EmilDohne closed 3 months ago

EmilDohne commented 3 months ago

This discussion showed that https://github.com/EmilDohne/PhotoshopAPI/discussions/71 when parsing in an incorrectly shaped numpy array it fails but in a rather unclear way which isnt necessarily helpful. To extend on this, we should add a warning when a non-1 stride is used on numpy arrays (which can happen if you call np.reshape() without calling .copy() on the array)