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

75 add a progress callback for reads and writes #76

Closed EmilDohne closed 3 months ago

EmilDohne commented 3 months ago

Added a progress callback which can optionally be attached to a LayeredFile<T>::read or LayeredFile<T>::write operation to asynchronously query the state of those tasks. This is especially useful for long operations on a large file or over a slow network connection.

This is currently only implemented on the C++ side but I would appreciate if someone would take the time to implement this on the python side too.

I have also added an example called ProgressCallbacks to illustrate how this can be used.

Fixes regression where passing a simple filename to either read or write (i.e. "OutputFile.psd" rather than "./OutputFile.psd") would cause a crash