parallax / parallax/jsPDF

jsPDF images are corrupted when using large, smartphone-captured jpegs

Open
#3,318 11 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

persistent
Dominant language
JavaScript
Stars
31.3k
Forks
4.8k
PR merge metrics
No merged PRs in 30d

Description

I've been trying to use the version 2.4.0 of jspdf to create a PDF containing images. However, the images are corrupted (basically just vertical stripes of grey).

The issues appears to be mainly affect jpegs that are captured from the camera directly. If you take a picture, crop it a little bit smaller and re-save it then it normally displays OK.

I've got a demo hosted at: https://upbeat-franklin-22e659.netlify.app/ that's written in knockout.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the hosted demo and a large, smartphone-captured JPEG using jsPDF 2.4.0. Compare that result with a cropped and re-saved JPEG, then trace the image-handling entry point involved. Done means the original large JPEG renders correctly in the generated PDF without vertical grey stripes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.