parallax / jsPDF

Client-side JavaScript PDF generation for everyone.
https://parall.ax/products/jspdf
MIT License
28.53k stars 4.61k forks source link

AddImage does not support files of type 'UNKNOWN' #3692

Open HADB opened 4 months ago

HADB commented 4 months ago

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

HADB commented 4 months ago

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:

HADB commented 4 months ago

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

github-actions[bot] commented 1 month ago

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.

HADB commented 1 month ago

3693 still not merged.

HADB commented 1 month ago

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!