jsPDF
jsPDF copied to clipboard
AddImage does not support files of type 'UNKNOWN'
I found my jpeg header starts with FF D8 FF E2
, which is not supported.
Here is the demo jpeg file:
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:
- 0xFF-D8-FF-E0 — Standard JPEG/JFIF file, as shown below.
- 0xFF-D8-FF-E1 — Standard JPEG file with Exif metadata, as shown below.
- 0xFF-D8-FF-E2 — Canon Camera Image File Format (CIFF) JPEG file (formerly used by some EOS and Powershot cameras).
- 0xFF-D8-FF-E8 — Still Picture Interchange File Format (SPIFF), as 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!