A frame-level wrapper over craft-jpeg: packets decode to gray or RGB
frames (Annex K Huffman tables put in for AVI MJPG packets that have
none) and frames encode to baseline JPEG packets. Checked against
ffmpeg as a black-box oracle in both directions.
Part of #1510.
probe_size returned Unsupported for PNG, JPEG and TIFF, so callers sized
those images with a full decode. Each now reads only its header with the
checks decode runs: PNG's IHDR/fcTL, limits and plausibility; JPEG's
first frame header and EXIF; TIFF's default page directory, camera-raw
refusal and Orientation tag. The size is turned upright for 5-8, as
decode returns it.
In a multipart file the chunks start after the offset tables of all
parts. The deep readers in craft-exr and craft-image-codecs took the end
of the deep part's own table as the start of the chunk area, so an
offset into a later part's table passed the chunk-area check and its
bytes were parsed as a chunk.
Both readers now compute where the deep part's table starts and where
the last table ends with checked arithmetic, and refuse a file whose
tables run past its end before reading any offsets. The earlier tables'
sizes are no longer capped or saturated.
Tests build a two-part file from scratch (a deep part and a 1x1 flat
part, in both orders): the deep part decodes as in a single-part file,
an offset into the second table or one byte before the end of the
tables is refused, and a file that ends inside the second table is
refused.
Extends the default-namespace theme test with an effect style holding
scene3d and sp3d, and adds a layout and master case whose unprefixed
extLst/ext is written back through ext_children.
To be precise about the previous commit: theme effect styles and shape spPr
3-D kept from a part with a default namespace now keep that namespace. Text
bodyPr and group spPr 3-D without a prefix are still dropped on save, as
before (valid_raw3d requires the a: prefix); that is out of scope here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A part written with a default namespace (`<theme xmlns="…/main">`, a slide with
`xmlns="…/presentationml/2006/main"`) has unprefixed names. `keep_with` copied
only prefixed declarations, so a kept fragment (theme custClrLst, extLst,
objectDefaults, effect 3-D, slide/layout/master extLst) lost its namespace when
written under a root that binds no default. A kept fragment now gets the part
root's `xmlns` when one of its unprefixed names is not bound inside it; prefixed
fragments are written as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adapt TextureCraft bdbb52c9b66b221a55b370105b42f485a76e6fc7 integer writer with exact wire oracle. Preserve common-delta tie-breaking and signed wrapping; cap combined output and scratch reservations and reserve fallibly.
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
DNG chapter 7 runs OpcodeList1 on the stored codes, then the
LinearizationTable maps them to sensor values. decode was applying the
table first, so a develop pipeline that later applied list 1 saw already
linearized samples.
When list 1 is present the table is now carried on RawImage and left
unapplied (`linearized` stays false). apply_linearization maps it after
the list. Files without list 1 are unchanged.
The dng-only build already compiles on main (d16ee792 gated
cr3::orientation). A comment at that gate records the E0433 failure
mode.
Part of #778.
Retain TextureCraft signed wrapping and delta widths from bdbb52c9b66b221a55b370105b42f485a76e6fc7; use explicit widths, output byte budget, checked code-table admission and fallible reservation.
Extract framing from PhotoCraft 16941f7198da9ae1811a8928f4c256b5cb37c1cb, retaining the overflow protection added by 3b45e8baee7117e53847523b5bc3ae2b337966d4. Allocation-free adaptation leaves text policy with callers.
Co-authored-by: Valentin Klein <vangel1976@googlemail.com>
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
Source: storytold/texturecraft bdbb52c9b66b221a55b370105b42f485a76e6fc7. Preserve chunk framing and output cap policy, with fallible allocation and checked offsets.
Port raw framing from PhotoCraft f7f8fdcd89 and 9a390661b5; preserve tolerant import semantics and keep colour policy with consumers.
Co-authored-by: Khawar Zamman Wani <wanikhawar@gmail.com>
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
Extract the TextureCraft writer originally introduced in 59f0ab48508e2dc5a812acd1aee00d5d59a528d8, retaining caller colour and timestamp policy. Preserve the is_multiple_of cleanup from 59a3018.
Co-authored-by: bflatastic <bflat@storyteller.ai>
Float::z kept relativeHeight as read, so a file's 0, the lowest order a
file can give, read as 0, "none", which stacks above every object. z is
now one more than the file's (as ODF's draw:z-index is read), and
Float::stack gives the stacking key. The writer writes stored orders one
less, numbers objects made in the app above every stored one, and
numbers the stored ones again from Word's first order when u32::MAX
leaves no room above them. Document::stacking_orders counts every story
saved with the document, the glossary's building blocks included.
Moved from storytold/wordcraft#2655 (wordcraft#2638), whose DOCX reader
and writer now live here.