loonghao / photoshop-python-api

Python API for Photoshop.
https://loonghao.github.io/photoshop-python-api/
MIT License
644 stars 75 forks source link

_ctypes.COMError #83

Open jaye-li opened 3 years ago

jaye-li commented 3 years ago

Describe the bug I want to rasterize all layers imported from PDF,but i received : _ctypes.COMError: (-2147352577, '出现了内部错误。', (None, None, None, 0, None))

To Reproduce my code: for j in doc.layers: j.rasterize(target=5)

the tracebake: image

Desktop (please complete the following information):

Additional context thanks for your solution!

jaye-li commented 3 years ago

@loonghao

jaye-li commented 3 years ago

though the error message appears in pycharm,layers can still be rasterized in Photoshop: image now I use "try...except..." to cuntiue

loonghao commented 3 years ago

@jaye-li Can you give me a test psd file? This is convenient for me to debug, I tested several situations are normal

blunderedbishop commented 2 years ago

Happens to me when the file i want to work on is not on focus.