Skip to content

LDEV-6083 lazy BufferedImage decode, remove Commons Imaging from metadata path#34

Open
zspitzer wants to merge 5 commits into
masterfrom
LDEV-6083-metadata
Open

LDEV-6083 lazy BufferedImage decode, remove Commons Imaging from metadata path#34
zspitzer wants to merge 5 commits into
masterfrom
LDEV-6083-metadata

Conversation

@zspitzer
Copy link
Copy Markdown
Member

@zspitzer zspitzer commented Feb 5, 2026

What

Metadata ops (imageInfo, imageGetEXIFMetadata, imageGetIPTCMetadata, imageGetWidth/Height) no longer force a full BufferedImage decode. Commons Imaging is also removed from the metadata path entirely — orientation now comes from Drew.

Why

Metadata ops on a 3MB JPEG were decoding ~40MB of pixels just to read Make/Model. Drew reads only the header bytes.

Numbers (9950X3D, mixed 333-file corpus)

Metric Before After Speedup
imageInfo warm 17.85ms/file 7.27ms 2.46×
imageGetEXIFMetadata 17.89ms/file 7.50ms 2.38×
Concurrent: big allocations baseline −78%
Concurrent: lock contention baseline −88%

JFR: the Commons Imaging GIF LZW hotspot is eliminated entirely (was 96 samples, now 0).

Tests

  • 472 pass / 1 fail on Lucee 6 and Lucee 7
  • The 1 fail is LDEV0006 (pre-existing 185-vs-137 EXIF field count, unrelated)
  • New tests/LDEV6083lazy.cfc — 7 assertions failing on master (red phase), passing here (green). Public Image.isDecoded() added as the test hook.

Not in this PR

  • ApacheImagingCoder and JPEGDecoder still use Commons Imaging for pixel decode (PCX/PNM/WBMP, custom JPEG CMYK). Separate decision, not a metadata concern.

https://luceeserver.atlassian.net/browse/LDEV-6083

@zspitzer zspitzer force-pushed the LDEV-6083-metadata branch from c88ec3d to dd6bff1 Compare April 22, 2026 12:39
@zspitzer zspitzer changed the title LDEV-6803 optimize image info, lazy read LDEV-6083 lazy BufferedImage decode, remove Commons Imaging from metadata path Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant