Commit Graph
4320 Commits
Author SHA1 Message Date
FredAppsandClaude Opus 5.5 ac4f26a00d chore: revert unrelated churn from #2155
Restore main's text where the PR changed things it did not need to:
intra-doc links turned into plain code spans (engine js.rs and
camera_edges.rs, forms raster.rs, fonts pdf.rs, sign keys.rs and
pkcs12.rs, ui-egui motion.rs and web_print.rs), the #[allow(dead_code)]
on render's byte_capacity and ui-egui's unit_for_tag (both are used on
every native target, as on main), the loosened combine_grid timings, the
forms test case rename (scratch() already numbers its folders), and the
computed xref size in a_recovered_page_tree_survives_a_full_save (always
5 there).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 12:33:50 +01:00
FredAppsandClaude Opus 5.5 92de289ecc fix(engine): spend the font budget only on fonts the picker lists
discover charged each candidate's size against the 64 MiB budget before
reading it, so proprietary or broken files early in a fonts folder could
use the budget up and hide openly licensed fonts after them. Charge only
fonts that pass validation and are not duplicates. Reads are still
bounded: every file read counts against four times the budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 12:33:50 +01:00
FredAppsandClaude Opus 5.5 3817a9f3ec refactor(engine): drop redundant image and font checks
- page_image_at: PageImage::contains already requires the point inside
  visible_rect (rect clipped by the placement clip), so the extra bounds
  test before it decided nothing.
- image_dimensions: the 256 MB input-length guard repeated the caller's;
  the decoder's max_alloc limit still caps what decoding allocates. Its
  test no longer allocates 256 MB to hit that guard.
- font_content_key hashed every font file twice; one 64-bit hash plus the
  length is enough to tell duplicate files apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 12:33:49 +01:00
FredAppsandClaude Opus 5.5 4c70761803 refactor(engine): use pdfcraft_content::Matrix for added-image edits
run_edit_page_image carried its own inverse, bbox and multiply; Matrix
already has invert, bbox and then with the same formulas and the same
degenerate-determinant guard. Also drop the second finite check on Move
(checked on entry), match the added item with two finds instead of a
four-way chain, and toggle flips in one place for both the parallel and
perpendicular cases. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 12:33:49 +01:00
FredAppsandClaude Opus 5.5 4416405232 refactor(fonts): drop the unused TrueType subsetter
subset_truetype, subset_tag and their table helpers had no caller apart
from their own test, and validate_document_input validated twice: names()
already runs validate() first. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 12:33:49 +01:00
Grzegorz MartensandClaude Opus 5.5 5660075295 M8: the test of rows too wide for Group 4 says Group 4 refused them
Flate coming out didn't show that: Group 4 could have been coded and lost on size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-11-01 12:15:58 +01:00
FredAppsandClaude Opus 5.5 25916985ca fix(ui): keep document_area under the complexity gate after merging main
Main's page-edge-shadow preference (#2088) added a fade-strength branch to
document_area, and this branch's image-menu work added others; together they
put it one over clippy's cognitive-complexity limit. page_scroll, its only
caller's scroll helper, now takes the fade flag and restores the spacing itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 11:26:22 +01:00
FredAppsandClaude Opus 5.5 29913dcfca Merge current main into #2155
Brings the branch up to date with main (47f42ba0), which moved 37 commits since
the merge base, including page-edge shadows (#2088), full rewrite after page
delete (#4279) and the licence-check stage (#2212). No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 11:23:43 +01:00
RiceDee d90cf79a2a fix(ui): the line spacing list keeps its column in every language (#5634)
A longer "Auto" (Czech "Automaticky") pushed the list 46 pt past the Tools pane at its
narrowest. It is now cut short, with the whole word in the list's menu and tooltip. A test
checks the lists in every interface language the fonts can draw, and the narrow-pane test also
runs at the largest interface size.
2026-11-01 20:02:38 +11:00
Grzegorz MartensandClaude Opus 5.5 db4162d2ef test(create,optimize): the other way round, the same size and larger
The shapes in these tests all ran one way. The way round depends on the shapes: 1 × 100,000 to
100,000 × 1 asks for 10 GB if it goes across first, or 30 GB at three components, so that is held to
as well. A mask of its image's size comes through byte for byte, and a larger one scales.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-11-01 09:31:58 +01:00
Grzegorz MartensandClaude Opus 5.5 33d7a51301 M2: a reference in /Decode, /W or a palette that leads back to itself ends
Colour spaces already had tests of this through their bases. `/Decode`, in the renderer and in image
export, `/W`, `/W2` and an Indexed space's table hadn't: each read now has such a reference in its
test, and ends.

These hold that the read ends, not what value it comes to. A reference to a reference in a number
array reads as the first number of that reference in the renderer (`/Decode [11 0 R 0]`, with 11
naming 6 and 6 holding 1, reads as 6). That is older than this branch, in `IndirectObject::read` for
an object stored on its own and `ObjectStream::get` for one in an object stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-11-01 09:31:58 +01:00
Grzegorz MartensandClaude Opus 5.5 43202e10f9 M2.6: a page of many pictures stops at the export's allowance
The allowance's sharing was tested on a few images. This runs a whole page through the export: the
pictures past it are left out and counted, and the page is listed, which is what the warning goes
by. A few large pictures all come through. The README gives the numbers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-11-01 09:31:58 +01:00
RiceDee 9538640f56 fix(ui): a bookmark made in the page grid goes to the current page (#5636)
The grid moves the viewport without refreshing where the pages are on screen, so
bookmark_position now gives no position there.
2026-11-01 19:19:23 +11:00
RiceDeeandClaude Sonnet 5.5 560acae86e fix(ui): the sliver bookmark_position ignores is one physical pixel, not one point (#5636)
Page rectangles snap to whole physical pixels, so what counts as rounding scales with the display:
the view keeps last frame's pixels per point and the threshold is its inverse.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 19:00:15 +11:00
RiceDeeandClaude Sonnet 5.5 1bb7da1372 test(ui): quick_bar_offset is pinned at the margin that just holds the bar, a point less, and 1000 pt (#5635)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 18:50:54 +11:00
Grzegorz MartensandClaude Opus 5.5 025050942c M12: each of the nine anchors turns, at each turn
Rotation was tested from the top left and the bottom right. The other seven share that code, but
nothing held them to it. What is asked for comes from the box's corners in the test, not from layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-11-01 08:46:27 +01:00
RiceDeeandClaude Sonnet 5.5 3896e6c30a fix(ui): the rail's page and zoom fields are wide enough for "6400%", and the sliver size is named (#5636)
At 36 pt the largest zoom was cut off at the right. The fields are 42 pt, set by RAIL_FIELD_SIZE
and pinned in the rail test. The one-pixel tolerance in bookmark_position is the constant SLIVER.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 18:46:01 +11:00
RiceDeeandClaude Sonnet 5.5 461200e74a fix(ui): bookmark_position keeps a sliver page when nothing else shows; the rail test checks the rail's real edges (#5636)
A page showing under a pixel at the window's top is ignored in favour of the next page, but still
chosen when no other page shows. The rail test no longer tolerates 2 pt of overflow: it compares the
page and zoom fields with the rail's own edges.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 18:37:23 +11:00
RiceDeeandClaude Sonnet 5.5 cab29b4f19 fix(ui): the rail is 49 pt wide with larger zoom buttons, and two position checks allow a pixel of rounding (#5636)
The rail is a point wider, and its side padding is 1 pt, so the zoom out and in buttons are half
the rail's inner width each (about 22 pt) and leave a pixel to the rail's edge.

The wider rail moves the page by a pixel, which exposed two checks that depended on exact pixels:
bookmark_position counted a page showing under a pixel at the window's top as the one the reader
is at, so a bookmark made after a jump went to the previous page; and the sidebar scroll test
compared positions to under a pixel, though page rectangles snap to whole pixels.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 17:56:58 +11:00
RiceDeeandClaude Sonnet 5.5 8f1d23d991 test(ui): the Format text narrow-pane test checks the font list against the pane's content edge (#5634)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 17:15:43 +11:00
RiceDeeandClaude Sonnet 5.5 db0383b97c fix(ui): the quick bar centres by its rendered width, and a NaN margin keeps 14 pt (#5635)
Fill & Sign's Text and Date tools widen the bar, so the fit check and the centring now use last
frame's width of the bar. A NaN margin used to count as 100 pt through `f32::min`.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 17:12:07 +11:00
RiceDeeandClaude Sonnet 5.5 889472f16f fix(ui): the rail's page box fits, and the zoom field looks like a field (#5636)
The page box lost its right edge to the rail. The page and zoom fields now share one helper
that boxes them and sizes them to the rail, with the same 12 pt font. Zoom out and zoom in are
small buttons side by side under the zoom field. The rail's side padding is 4 pt, not 6.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 16:49:25 +11:00
RiceDeeandClaude Sonnet 5.5 6365e2ed47 fix(ui): centre the quick-tools bar in the margin beside the page (#5635)
The bar stood a fixed 14 pt from the side panel, so its gap to the page changed with zoom and
window size. It now centres in the margin between the panel and the page when the margin holds
it, within the first 100 pt; otherwise it keeps 14 pt in.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 16:42:02 +11:00
RiceDeeandClaude Sonnet 5.5 6734f9f3b4 fix(ui): Format text fields read as fields, line up, and fit the Tools pane (#5634)
The font, line spacing, paragraph spacing, scale and character spacing fields get an outline
and fill, with one box round each number and its arrow. Line and paragraph spacing text is
centred, and the two-column rows end at the font list's right edge.

The Tools pane has equal 14 pt margins and a minimum width worked out from its widest Format
text row, so the alignment button is no longer cut off. The Edit and tool-detail rows stop
short of the floating scrollbar, through a helper shared with All tools (#5133).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 16:33:17 +11:00
Dylan M. Taylor 47f42ba07b ci: grant packages write permission to release workflow 2026-10-31 23:43:03 -04:00
Grzegorz MartensandClaude Opus 5.5 2afbf55cd2 M12: an XFA draw placed by position turns about its anchor
Nothing read rotate, so a turned line, picture or label was drawn as if it
stood upright: part of #5561. XFA gives the angle in degrees counter-clockwise
about the anchor, and Acrobat's flattened page for that issue's form puts the
three turned lines exactly there, which the test holds it to.

A turned draw is one item: a page break moves it whole, and what it holds is
written unturned under one matrix, so text, pictures and borders need nothing
of their own. The page count and link annotations look inside it, and its
container grows to the box it stands in. Fields, subforms and draws in a flow
don't turn yet.

That issue's own form is static, so it already shows Acrobat's page: this is
for dynamic forms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-11-01 02:59:32 +01:00
Grzegorz MartensandClaude Opus 5.5 640e7acb15 fix(create,optimize): a mask of other proportions doesn't take the process down
Scaling goes down first, through a buffer of the source's width by the target's
height at 16 bytes a pixel, and neither image's size limit bounds that product.
A soft mask of 60,000 × 1 on an image of 1 × 60,000, about a kilobyte of PDF,
asked for 57 GB and aborted the process, in image export, Office export, Copy
Image and Optimize at its default settings. The same shapes in smaller sizes
held gigabytes.

Such a picture is scaled across first, which holds no more pixels than one of
the two has, so the size limits bound it after all. Proportions that aren't
far apart scale as they did, to the byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-11-01 02:28:29 +01:00
Grzegorz MartensandClaude Opus 5.5 2fb88feaf7 M2.6: a JPEG pays for being read before its header is
Reading a JPEG's header was free, and it can be most of the file: a mask of
1 MiB of tables that disagreed with its dictionary, shared by 4,000 images,
took 101 s with none refused, and that time grows as the square of the file.
A JPEG now pays 4 steps a byte before its tables are parsed, on every path, and
a mask's header is read once. That is a bound and not a speed-up: the same
file of 4,000 images fits the allowance and still takes 97 s, and 12,000 stop
after 10,233 in 250 s.

A chain that can't run pays nothing for its pixels, and the docs say what past
the allowance isn't counted: LZW streams the image pass didn't read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-11-01 01:57:39 +01:00
Grzegorz MartensandClaude Opus 5.5 7bfdfd293a M2.6: image export pays for a JPEG mask, and reads a JPEG's size first
A JPEG that was itself a mask paid nothing, and images can share one: 300
images in 66 KB took 135 s with none refused, about 0.45 s for 220 bytes. It
now pays for its samples each time an image reads it.

Export priced a JPEG by its dictionary and decoded the size in its header,
comparing them only afterwards: an image of one pixel over a header of 500
megapixels cost 2 steps and 0.3 s. Both paths now read the header first and
leave a JPEG that disagrees undecoded, as Optimize and the CMYK path do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-11-01 01:01:22 +01:00
Grzegorz MartensandClaude Opus 5.5 ade8ebbdb4 M2.6: a run pays for what a stream costs, not what it holds
Four ways round the allowance, each measured by a review of hostile input:

A Flate stream read as zlib that fails at once, and then as raw deflate that
decodes everything before failing, gave nothing back and so was charged
nothing, here and in DecodeBudget: 110 s for a 387 KB file, all decoded. What
the retry decoded now counts, though the data is still dropped as it was.

Fax and 1-bit Flate images paid by the byte for work done by the pixel: 19
bytes can be a blank page of 100 million pixels, about a second each. Every
image decoded here now pays for its pixels first, as JBIG2 already did.

A JPEG paid nothing, and what one asks for doesn't grow with its length: 156
bytes declared 80 megapixels, 72 s for an 8 KB file. A JPEG pays for its
samples before it is decoded, in Optimize and in an export that has to decode
one for its mask.

Merging fragments paid for reading strips and not for the picture it built:
393 s for 1,154 bytes. It pays for the picture before allocating it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-11-01 00:20:43 +01:00
FredApps eea00a6186 Merge pull request #2088 from srt8hellcat2-ui/fix/1577-optional-page-edge-shadows-integration
M3: Add optional page-edge shadows setting (fixes #1577)
2026-10-31 23:42:20 +01:00
FredApps f2e1a8ce29 Merge branch 'main' into fix/1577-optional-page-edge-shadows-integration 2026-10-31 23:38:40 +01:00
FredApps a471cb1664 Merge pull request #1433 from srt8hellcat2-ui/feature/two-paged-cli-1354
M3: add optional --two-paged CLI flag (fixes #1354)
2026-10-31 23:35:31 +01:00
FredApps 19c96011b2 Merge pull request #2212 from srt8hellcat2-ui/feat/license-check-stage1
Add automated licensing validation for bundled assets (#2175)
2026-10-31 23:27:03 +01:00
Grzegorz MartensandClaude Opus 5.5 696728686f M2.6: Optimize's LZW pass spends the run's allowance, and Cancel reaches it
Storing LZW streams with Flate decoded image streams outside the allowance,
with a limit for each stream and no total, and nothing asked whether to go
on: a 593 KB file of 100 images took 113 s with none refused, and images
refused by the image pass were still rewritten. The pass now pays for what
it decodes and for storing and checking it, at 8 steps a byte since Flate
takes up to 78 ns a byte, and streams past that stay LZW.

An image is counted as refused only when it stayed as it was: one packed
before the allowance ran out on its second read was rewritten. doc_reduce
reports images_refused as doc_optimize does, and the app's action says so
in its log. A refused image no longer reads as an unsupported filter:
FilterError::Spent says what happened.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 23:26:25 +01:00
FredApps 2e853c5fe0 Merge pull request #4279 from srt8hellcat2-ui/fix-3407-rewrite-after-page-delete
Rewrite an unsigned file in full when saving after deleting pages
2026-10-31 23:24:48 +01:00
FredApps 9af62ceb38 Isolate UI frame-budget measurements under nextest 2026-10-31 23:07:05 +01:00
Combiler01 b77699a22b test(optimize): accept Flate or CCITT compression in monochrome scan test 2026-10-31 22:50:50 +01:00
Combiler01 af03f08494 test(optimize): accept Flate or CCITT compression in monochrome scan test 2026-10-31 22:50:50 +01:00
Combiler01 0475725247 test(optimize): accept Flate or CCITT compression in monochrome scan test 2026-10-31 22:50:50 +01:00
Combiler01 9a655ddb2d test(optimize): accept Flate or CCITT compression in monochrome scan test 2026-10-31 22:50:50 +01:00
FredApps e5f21f2dbb Keep licensing checks below the current complexity gate 2026-10-31 22:26:16 +01:00
FredApps 1d5ce9d7a9 Update shadow regression wheel events and retain upstream parity notes 2026-10-31 22:26:16 +01:00
Grzegorz MartensandClaude Opus 5.5 083191f970 M2.6: every filter of a run's images pays, whether or not it works
Filters were charged only for what they handed a JBIG2 decoder, once they
had handed it over: a chain that failed, or went past its image's limit,
cost its time and nothing else, and images that weren't JBIG2 weren't
charged at all. A 734 KB file of 200 images of Flate inside Flate took an
image export 111 s, and that grew with the file. It now takes 12 s.

Each byte read and each byte a stage decodes is now a step of the same
allowance, paid as it happens, so no stage runs past what is left. That
holds for every image read through ImageBudget, and a fax image pays for
its rows and its code. JBIG2 globals pay when they have to be read, and
kept ones don't. Optimize's two reads that went round the budget go
through it, and merging fragments shares it.

Optimize reads an image twice, to pack it and to resample it, so a refused
image is now counted once a run rather than once a read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY
2026-10-31 22:23:06 +01:00
FredApps fdcf66d5f6 Apply licensing validation to newly added upstream Lucide icons 2026-10-31 22:16:52 +01:00
FredApps 50780519e3 Merge current main into PR2212 and reconcile license inventory and shared CI 2026-10-31 22:14:35 +01:00
FredApps bad4c81800 Merge current main into PR2088 and port shadow preference to split UI modules 2026-10-31 22:13:25 +01:00
FredApps 286a3c6eee Merge current main into PR1433 and preserve launch override across module splits 2026-10-31 22:12:05 +01:00
FredApps 7165ff1ace Merge current main into PR4279 and retain unsigned delete-save policy 2026-10-31 22:09:56 +01:00
Dylan M. Taylor 13655d0992 packaging(flatpak): add OCI image build and GHCR publishing helper (#5526) 2026-10-31 15:33:25 -04:00