JavaScript-Load-Image
JavaScript-Load-Image copied to clipboard
Failure on Webkit Mac App
Tested on Safari, Chrome and Webkit Mac app.
The file on this link: https://reminis-pip-pab.s3.amazonaws.com/DW_ET.jpg
It gives "Invalid JPEG metadata: Invalid segment size." error on Webkit Mac App. It is in function parseMetaData(file, callback, options, data) line 137
It gives a strange file attached below on load. It's 4 bytes jpeg. and canvas.toBlob gives null blob.
There is no problem with Chrome and Safari with the same code.
Hi @ozgurozkan123, sorry for the late reply. Unfortunately the file you provided is not accessible anymore. Can you upload it somewhere more permanent so we can have a look?
I have the same problem with all my images =(
Chrome on Windows
@darkvovich
The Invalid JPEG metadata: Invalid segment size.
error is logged if the length defined in a JPEG APPn segment exceeds the size of the maxMetaDataSize
option or the size of the file.
It seems like the image blob generated from a Canvas for your picture contains a JPEG APP2 segment that is larger than what is defined as maxMetaDataSize
for image head replacement (currently 256
bytes).
I'm not sure why the Canvas generated image contains a bigger sized meta data segment for your image (since canvas data does not retain JPEG meta data), but I'll release a fix that raises this to 1024
bytes.
Thx!