Page MenuHomePhabricator

JPEG image is reported with the wrong mime-type application/octet-stream
Closed, ResolvedPublicBUG REPORT


$ curl -sI | grep content-type
content-type: application/octet-stream

but the image seems to be a good and proper jpeg:

$ file WLJ_photo3.jpg
WLJ_photo3.jpg: JPEG image data, JFIF standard 1.02, resolution (DPI), density 72x72, segment length 16, Exif Standard: [TIFF image data, little-endian, direntries=16, height=3615, bps=206, compression=none, PhotometricIntepretation=RGB, manufacturer=Phase One, model=P 45, orientation=upper-left, width=2714], baseline, precision 8, 192x230, components 3

So, the content-type in the HTTP response header should be image/jpeg like actually written in the image description page at

Reported first because for mwoffliner at because it has an impact in ZIM snapshots.

Event Timeline

For some reasons the file was uploaded to the swift storage engine with incorrect mime type I guess...

A shell user could try and run mwscript maintenance/refreshFileHeaers --wiki=commonswiki --verbose --refreshContentType --start=WLJ_photo3 --end=WLJ_photo4 which should reset the header in swift if I understand correctly

Afterwards the command should show that this is a jpeg.

$ curl -sI | grep content-type
content-type: image/jpeg

@Reedy Would you be able please to help here?

Reedy claimed this task.
reedy@deploy1002:~$ mwscript maintenance/refreshFileHeaders.php --wiki=commonswiki --verbose --refreshContentType --start=WLJ_photo3 --end=WLJ_photo4
Processing next 1 row(s) starting with WLJ_photo3.jpg.
Queued headers update for file 'WLJ_photo3.jpg'.
Updating headers for 1 file(s).
Done. Updated headers for 1 file(s).
reedy@deploy1002:~$ curl -sI | grep content-type
content-type: image/jpeg