Skip to content

fix: support application/octet-stream for base64 images in DocMeasure - #2939

Open
nayneshrathod wants to merge 2 commits into
bpampuch:masterfrom
nayneshrathod:develop-naynesh
Open

fix: support application/octet-stream for base64 images in DocMeasure#2939
nayneshrathod wants to merge 2 commits into
bpampuch:masterfrom
nayneshrathod:develop-naynesh

Conversation

@nayneshrathod

Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings July 13, 2026 19:19
@nayneshrathod

Copy link
Copy Markdown
Author

fix: support application/octet-stream for base64 images

Updated the regex in convertIfBase64Image within DocMeasure.js to properly identify and parse base64 image strings that are provided with the application/octet-stream MIME type instead of standard image types. This ensures these images are efficiently cached and processed by PDFKit without throwing an "Unknown image format" error.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates DocMeasure’s base64 image detection to also accept data:application/octet-stream;base64,... data URLs, allowing images supplied with a generic MIME type to be processed like other inline images.

Changes:

  • Expanded the convertIfBase64Image data-URL regex to match application/octet-stream in addition to common image/* types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/DocMeasure.js Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants