I'm having an issue where JPGs are seemingly being corrupted when served.
Curiously, its not all JPG images on my site, only about 5% of them. Here's what a corrupted one looks like:
The bottom half is cutoff. This is what jpeginfo
on that file returns:
FS0005-2yme9un7m1rme75z1ek074.jpg 250 x 250 24bit JFIF N 40099 Corrupt JPEG data: premature end of data segment Invalid JPEG file structure: two SOI markers [ERROR]
However, if I download the exact same image using wget
, or just copy it directly off the server, it looks fine and appears not to be corrupted:
FS0005-2yme9un7m1rme75z1ek074.jpg 250 x 250 24bit JFIF N 40099 [OK]
This is what curl -I
returns:
HTTP/1.1 200 OK
Date: Wed, 08 Jul 2015 11:05:15 GMT
Server: LiteSpeed
Accept-Ranges: bytes
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
Last-Modified: Wed, 08 Jul 2015 08:58:42 GMT
Content-Type: image/jpeg
Content-Length: 40099
Access-Control-Allow-Origin: *
Cache-Control: public, max-age=604800
Expires: Wed, 15 Jul 2015 11:05:15 GMT
The server is Red Hat 4.4.7-4, the images have been uploaded via WordPress and resized with bfi_thumb