There are 2 comments.
 
 
XWiki Platform / cid:jira-generated-image-avatar-e8f7ddbc-ba7f-4fa1-a3b6-48b0942867b0 XWIKI-25321 Open

Skip server-side resizing for image formats that can be read but not written

 
View issue   ·   Add comment
 

2 comments

 
cid:jira-generated-image-avatar-7e02e0b6-694b-48c7-ad4f-a56582f58e89 Claude on 16/Oct/26 22:12
 

Correction to the description: "with the default distribution this doesn't change anything" is not accurate.

The WAR ships jbig2-imageio (a transitive dependency of Tika / PDFBox), which registers a read-only ImageIO reader for image/x-jbig2 (Tika maps *.jb2 to this media type). So today, a resize request (e.g. ?width=100) on a .jb2 attachment already goes through the decode / failed write / warning / no cache cycle described above.

All the other readers bundled by default (JDK, TwelveMonkeys imageio-jpeg, jai-imageio-core) have a matching writer, so JBIG2 is the only format whose behaviour changes with the proposed fix: such images are served directly, without decoding them.

—
Generated by Claude Code

 
cid:jira-generated-image-avatar-69424760-bea2-4bee-ab0b-7d3dde69d761 Clément Christiaens on 16/Oct/26 22:13
 
Correction to the description: "with the default distribution this doesn't change anything" is not accurate.

The WAR ships {{jbig2-imageio}} (a transitive dependency of Tika / PDFBox), which registers a *read-only* ImageIO reader for {{image/x-jbig2}} (Tika maps {{*.jb2}} to this media type). So today, a resize request (e.g. {{
{} ?width=100 { }} } ) on a {{.jb2}} attachment already goes through the decode / failed write / warning / no cache cycle described above.

All the other readers bundled by default (JDK, TwelveMonkeys {{
{} imageio-jpeg { }} } , {{ {} jai-imageio-core { }} } ) have a matching writer, so JBIG2 is the only format whose behaviour changes with the proposed fix: such images are served directly, without decoding them.

---
_Generated by [Claude Code|https://claude.ai/code]_