AppWerft / TiJSPDF

Other
9 stars 9 forks source link

Does not work if JPEG images have been optimised using ImageOptim #4

Closed raefa closed 9 years ago

raefa commented 9 years ago

It took me a while to figure this out! Image Optim (https://imageoptim.com/) must strip out the headers and jsPDF must rely on the headers to get the dimensions of the file. Should probably fail a little more gracefully than this:

[ERROR] [iphone, 8.4, 192.168.0.116] {
  "stack": "getJpegSize\naddImage\nsubmitForm",
  "column": 73,
  "line": 2163,
  "message": "getJpegSize could not find the size of the image"
}
AppWerft commented 9 years ago

Your suggestion?

raefa commented 9 years ago

Hmmm. Maybe we put a more descriptive error message in there. "getJpegSize could not find the size of the image. This may be because the headers of the JPEG have been removed or the image cannot be found." I can't think of anything better really!

AppWerft commented 9 years ago

Thanks. I have changed the text