Trying to upload this image (nsfw) raises a corrupted file exception. Every other program can decode it, so I'm not sure why this is the case.
Posted under General
Trying to upload this image (nsfw) raises a corrupted file exception. Every other program can decode it, so I'm not sure why this is the case.
An image is determined to be corrupt if calling stats on it fails
The error I'm seeing is "Invalid SOS parameters for sequential JPEG", whatever that means
There is some extra data at the end starting at 0xb71f2. Usually metadata for jpg is near the start of the file. Perhaps deleting it and re saving in a hex editor would fix it for upload.
The ending bytes of a jpg is usually 0xFFD9
HxD is what I use.
I tried using what were supposedly "online lossless image optimizers" and their outputs are completely different sizes from eachother so they're fucking lying asses.
I deleted the remaining bytes starting from 0xb71f2 and VIPS considers it invalid even without the extraneous data.
I've determined it's a hyper specific issue regarding the way Galaxy S9s encode JPGs under certain conditions which will never be fixed.