Page MenuHomePhabricator

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

Description

$ curl -sI https://upload.wikimedia.org/wikipedia/commons/a/af/WLJ_photo3.jpg | 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 https://commons.wikimedia.org/wiki/File:WLJ_photo3.jpg

Reported first because for mwoffliner at https://github.com/openzim/mwoffliner/issues/1540 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 https://upload.wikimedia.org/wikipedia/commons/a/af/WLJ_photo3.jpg | 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 https://upload.wikimedia.org/wikipedia/commons/a/af/WLJ_photo3.jpg | grep content-type
content-type: image/jpeg