Topic on Project:Support desk

No JPG thumbnails after 1.38 upgrade

Summary by JalapenoParty

Enable PHP exif module

JalapenoParty (talkcontribs)

After upgrading to 1.38.0 from 1.37.2, new JPG images are not having thumbnails created. The file page shows a white box and a size of 0x0 pixels. PNG files work as expected. The original file is uploaded successfully, as accessing the file directly through the webserver displays it correctly.

What I've tried to far:

  • Looking for obvious PHP or webserver errors. I don't see anything.
  • Switching from Imagemagick to gd. Same results.
  • Confirmed that the images and images/thumb directories have the proper permissions. Yes, they are 755 and owned by the appropriate user.
  • Turned on $wgDebugLogFile to find more details. This is where it gets interesting. For PNG files, I can see where it tries (and succeeds) in generating thumbnails. It calls out to /usr/bin/convert as expected. For JPG files, these lines are nowhere to be found. It's like it's not even trying to create a thumbnail.

Any ideas?

Bawolff (talkcontribs)

It could be a metadata extraction issue. If mediawiki cannot detect the dimensions of the file, it gets reported as 0x0 and it will assume file is broken so it wont try to thumbnail.

Try recording the debug log when uploading a new jpg file, see if anything weird is in the log.

JalapenoParty (talkcontribs)

That pointed me in the right direction, thank you!

I found the error:

JpegHandler::getSizeAndMetadata: Internal error: exif_read_data not present. $wgShowEXIF may be incorrectly set or not checked by an extension.

So I just needed to enable the exif module in my PHP configuration. I am confused why this happened though. I don't see any mention of this module in the official requirements, nor any changes to it in the 1.38 release notes. My system's PHP package also hasn't been updated since originally installed.

Do you know if this is a documentation issue, or did I just miss something?

Bawolff (talkcontribs)

In theory its supposed to still work without it. Maybe the fallback broke at some point and nobody noticed.

Jacob Steffler (talkcontribs)

Submitted a bug report (T310013) and marking as resolved.

(Same user here, I forgot my Wikipedia account carried through to other WM sites.)