mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-30 13:08:48 -06:00
LiveCycle Designer wrote BMPs whose file header gives bfOffBits = 0. image (0.25) seeks to that offset as given, so the pixels were read from the file header on and the picture was drawn shifted and wrapped around (#4937). `pdfcraft_xfa::image::bmp_with_pixel_offset` recomputes the offset from the info header (its size, BI_BITFIELDS masks in a 40-byte header, the palette) when the declared one lies inside the headers and the computed one fits in the file; anything else is passed through unchanged and not copied. XFA pictures (size and decode) and `create::from_images` both go through it, so pdfcraft-create gains a dependency on pdfcraft-xfa (L4 -> L3). Fixes #4937 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SqmHYx8FiWM5PcsoiErgp9