JavaScript-Load-Image icon indicating copy to clipboard operation
JavaScript-Load-Image copied to clipboard

Failure on Webkit Mac App

Open ozgurozkan123 opened this issue 3 years ago • 4 comments

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. 1607976297314_0_2da783815c7d850955cc9aba1edcd170

There is no problem with Chrome and Safari with the same code.

ozgurozkan123 avatar Dec 15 '20 01:12 ozgurozkan123

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?

blueimp avatar Sep 25 '21 01:09 blueimp

I have the same problem with all my images =(

Chrome on Windows osennyaya-doroga-les-trassa-asfalt

darkvovich avatar Oct 17 '21 21:10 darkvovich

@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.

blueimp avatar Oct 20 '21 14:10 blueimp

Thx!

darkvovich avatar Oct 20 '21 18:10 darkvovich