parallax / jsPDF

Client-side JavaScript PDF generation for everyone.

Home Page:https://parall.ax/products/jspdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AddImage does not support files of type 'UNKNOWN'

HADB opened this issue · comments

I found my jpeg header starts with FF D8 FF E2, which is not supported.

Here is the demo jpeg file:

hello-world

QQ截图20240116235923

Here's what I found: GCK'S FILE SIGNATURES TABLE

NOTES on JPEG file headers: The proper JPEG header is the two-byte sequence, 0xFF-D8, aka Start of Image (SOI) marker.
JPEG files end with the two-byte sequence, 0xFF-D9, aka End of Image (EOI) marker.

Between the SOI and EOI, JPEG files are composed of segments. Segments start with a two-byte Segment Tag followed by a
two-byte Segment Length field and then a zero-terminated string identifier (i.e., a character string followed by a 0x00), as
shown below with the JFIF, Exif, and SPIFF segments.

Segment Tags of the form 0x-FF-Ex (where x = 0..F) are referred to as APP0-APP15, and contain application-specific information. The most commonly seen APP segments at the beginning of a JPEG file are APP0 and APP1 although others are also seen. Some additional tags are shown below:

According to GCK'S FILE SIGNATURES TABLE, I created a PR(#3693) which supports CIFF & SPIFF files and will close this issue.

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

#3693 still not merged.

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

Not this issue is stale but this whole project is stale!