Skip to content

Cannot read production PSDs with smart objects in groups — DecompressRLE error (v0.9.1) #220

@EstebanAdso

Description

@EstebanAdso

Hi Emil,

What we're building: a headless service that opens existing Photoshop template files, replaces the contents of their Smart Object layers with new images, and writes the file back out.

The problem: LayeredFile.read(...) fails on every one of our real Photoshop files, with:

[DecompressRLE] Size of compressed data is not what was expected. Expected: 888182 but got 4656

raised as a RuntimeError, before we can do anything. We are on PhotoshopAPI 0.9.1 (Python bindings), Python 3.12, Windows.

What our files contain (typical production templates made in recent Photoshop):

  • CMYK color mode, .psd and large .psb (some banners are over 30,000 px wide).
  • Several Smart Object layers nested inside groups / artboards (not at the top level).
  • Modern Photoshop metadata blocks — right before the crash the log prints many "Unknown tagged block key CAI / OCIO / GenI" and "Signature does not match '8BIM' or '8B64'" warnings, which looks like the parser desyncs after skipping those blocks and then reads a wrong RLE length.

What we've confirmed:

  • A LayeredFile we create from scratch (one image layer, no groups, no smart objects) round-trips fine. So the install works.
  • The read failure reproduces on all our real files, from a small 2421×1132 CMYK PSD up to a 35433×3071 PSB — the common trait is smart objects inside groups + the metadata blocks above.
  • This looks related to the open issue Read psd issue #165 (same DecompressRLE + LayerMaskData padding message on mockup PSDs) and the open issue about "smart objects in folders unable to parse PSD."

What we're hoping for:

  1. Robust reading of production Photoshop files that have smart objects nested in groups/artboards plus modern metadata (CAI = Content Credentials, OCIO, GenI = Generative), without the parser desyncing.
  2. Then SmartObjectLayer.replace() + write() to .psb, ideally for documents over 30,000 px.

Is this a known limitation, and is a fix planned?

Thank you!

Metadata

Metadata

Assignees

Labels

PhotoshopFileIssues pertaining to the PhotoshopFile struct or usagebugSomething isn't workingc++

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions