Skip to content

Allow inserting an image as a new page when editing a PDF (bug 2032967)#21334

Merged
calixteman merged 1 commit into
mozilla:masterfrom
calixteman:merge_images
May 29, 2026
Merged

Allow inserting an image as a new page when editing a PDF (bug 2032967)#21334
calixteman merged 1 commit into
mozilla:masterfrom
calixteman:merge_images

Conversation

@calixteman
Copy link
Copy Markdown
Contributor

Image files dropped on or selected via the thumbnail viewer's "add file" picker are now accepted alongside PDFs and inserted as synthetic pages sized to the document's modal page dimensions.

The image-encoding helper previously embedded in StampAnnotation has moved to src/core/editor/pdf_images.js so it can be shared between stamp annotations and page synthesis.

@calixteman calixteman requested a review from timvandermeij May 25, 2026 16:30
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 25, 2026

Codecov Report

❌ Patch coverage is 87.25212% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.23%. Comparing base (389853d) to head (600986b).

Files with missing lines Patch % Lines
src/core/editor/pdf_images.js 89.47% 14 Missing ⚠️
src/core/editor/pdf_editor.js 91.94% 12 Missing ⚠️
src/core/annotation.js 35.71% 9 Missing ⚠️
web/pdf_thumbnail_viewer.js 83.72% 7 Missing ⚠️
src/display/api.js 70.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21334      +/-   ##
==========================================
+ Coverage   81.21%   81.23%   +0.02%     
==========================================
  Files         257      258       +1     
  Lines       65528    65793     +265     
==========================================
+ Hits        53216    53447     +231     
- Misses      12312    12346      +34     
Flag Coverage Δ
fonttest 9.02% <ø> (ø)
integrationtest 66.62% <12.18%> (-0.16%) ⬇️
unittest 56.50% <87.74%> (+0.10%) ⬆️
unittestcli 55.99% <19.03%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@marco-c marco-c changed the title Allow inserting an image as a new page when editing a PDF Allow inserting an image as a new page when editing a PDF (bug 2032967) May 25, 2026
Comment thread src/core/editor/pdf_images.js Outdated
Copy link
Copy Markdown
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me, with the comment addressed. This is a really nice feature; thanks!

Comment thread test/integration/reorganize_pages_spec.mjs Outdated
Comment thread src/core/editor/pdf_editor.js Outdated
Image files dropped on or selected via the thumbnail viewer's
"add file" picker are now accepted alongside PDFs and inserted
as synthetic pages sized to the document's modal page dimensions.

The image-encoding helper previously embedded in StampAnnotation has
moved to src/core/editor/pdf_images.js so it can be shared between
stamp annotations and page synthesis.
@calixteman calixteman merged commit 3fe3321 into mozilla:master May 29, 2026
22 checks passed
@calixteman calixteman deleted the merge_images branch May 29, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants