chinedufn / psd

A Rust API for parsing and working with PSD files.
https://chinedufn.github.io/psd
Apache License 2.0
268 stars 40 forks source link

Drag and drop example doesn't work on Safari #65

Open jakeleventhal opened 1 month ago

jakeleventhal commented 1 month ago

When dragging in a PSD I get this error in the browser console:

[Error] panicked at 'already borrowed: BorrowMutError', /rustc/fd4b177aabb9749dfb562c48e47379cea81dc277/src/libcore/cell.rs:877:9

Stack:

@https://chinedufn.github.io/psd/drag-drop-demo/drag_drop_browser.js:544:28
<?>.wasm-function[166]@[wasm code]
<?>.wasm-function[642]@[wasm code]
<?>.wasm-function[307]@[wasm code]
<?>.wasm-function[442]@[wasm code]
<?>.wasm-function[480]@[wasm code]
<?>.wasm-function[359]@[wasm code]
<?>.wasm-function[172]@[wasm code]
<?>.wasm-function[510]@[wasm code]
__wbg_adapter_18@https://chinedufn.github.io/psd/drag-drop-demo/drag_drop_browser.js:197:134
real@https://chinedufn.github.io/psd/drag-drop-demo/drag_drop_browser.js:187:21

    (anonymous function) (drag_drop_browser.js:556)
    <?>.wasm-function[166]
    <?>.wasm-function[642]
    <?>.wasm-function[307]
    <?>.wasm-function[442]
    <?>.wasm-function[480]
    <?>.wasm-function[359]
    <?>.wasm-function[172]
    <?>.wasm-function[510]
    __wbg_adapter_18 (drag_drop_browser.js:197:135)
    real (drag_drop_browser.js:187)
[Error] RuntimeError: Unreachable code should not be executed (evaluating 'wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0464633ff841b041(arg0, arg1, addHeapObject(arg2))')
    <?>.wasm-function[307] (drag_drop_browser.js:197:135)
    <?>.wasm-function[442]
    <?>.wasm-function[480]
    <?>.wasm-function[359]
    <?>.wasm-function[172]
    <?>.wasm-function[510]
    __wbg_adapter_18 (drag_drop_browser.js:197:135)
    real (drag_drop_browser.js:187)
chinedufn commented 1 month ago

What happens if you use the psd crate to deserialize the bytes?

As in, what happens when you call this method on your PSD https://docs.rs/psd/0.3.5/psd/struct.Psd.html#method.from_bytes ?

This will help us rule out whether it's an issue with the demo or an issue with the parser.

jakeleventhal commented 1 month ago

https://github.com/chinedufn/psd/issues/66#issuecomment-2379471339