Moodle Community Sites

Unable to display an image as thumb

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Component/s: docs.moodle.org
  • Labels:
    None

Description

Reproduce:

1. Open http://docs.moodle.org/en/Development:Workshop_module and edit it
2. Replace "[[Image:Moodle_Workshop_2.0.png]]" with "[[Image:Moodle_Workshop_2.0.png|thumb|Project mindmap|200px|left]]"
3. Try to preview or save

Expected:
The image appears as a thumbnail

Happens:
Blank page, change not saved

Possible reason
The image has been uploaded recently. Does mediawiki have a cron job to create thumbnail?

Activity

Hide
David Mudrak added a comment -

Adding Eloy to watch.

Also note if I try to open http://docs.moodle.org/en/Image:Moodle_Workshop_2.0.png I get an empty page as well. Probably some PHP error?

Show
David Mudrak added a comment - Adding Eloy to watch. Also note if I try to open http://docs.moodle.org/en/Image:Moodle_Workshop_2.0.png I get an empty page as well. Probably some PHP error?
Hide
Mauno Korpelainen added a comment -

... or some setting of Mediawiki?

Looking at source code <a href="/en/Image:Moodle_Workshop_2.0.png" class="image" title="Image:Moodle_Workshop_2.0.png"><img alt="Image:Moodle_Workshop_2.0.png" src="/en/images_en/5/50/Moodle_Workshop_2.0.png" width="2646" height="1509" border="0" /></a>

drops a part of path. The file is in

http://docs.moodle.org/en/images_en/5/50/Moodle_Workshop_2.0.png

Show
Mauno Korpelainen added a comment - ... or some setting of Mediawiki? Looking at source code <a href="/en/Image:Moodle_Workshop_2.0.png" class="image" title="Image:Moodle_Workshop_2.0.png"><img alt="Image:Moodle_Workshop_2.0.png" src="/en/images_en/5/50/Moodle_Workshop_2.0.png" width="2646" height="1509" border="0" /></a> drops a part of path. The file is in http://docs.moodle.org/en/images_en/5/50/Moodle_Workshop_2.0.png
Hide
Helen Foster added a comment -

Hi David,

I've had a play around and managed to display a branch of your mindmap as a thumbnail - see http://docs.moodle.org/en/Development_talk:Workshop_module

The only reason for the problem that I can think of is that your original image is too large. I don't know if there are any limits on height and width of images uploaded to the wiki, however http://docs.moodle.org/en/MoodleDocs:Style_guide states that images should have a maximum width of 800px.

Thus, I suggest you try to break your mindmap into sections and have a series of images, rather than one enormous one.

Show
Helen Foster added a comment - Hi David, I've had a play around and managed to display a branch of your mindmap as a thumbnail - see http://docs.moodle.org/en/Development_talk:Workshop_module The only reason for the problem that I can think of is that your original image is too large. I don't know if there are any limits on height and width of images uploaded to the wiki, however http://docs.moodle.org/en/MoodleDocs:Style_guide states that images should have a maximum width of 800px. Thus, I suggest you try to break your mindmap into sections and have a series of images, rather than one enormous one.
Hide
David Mudrak added a comment -

OK Helen, thanks for the advise. As I did not follow guidelines, this can't be considered bug anymore. Therefore I am resolving. However if Eloy finds time to check the MediaWiki error log I would like to know the exact reason of this.

Show
David Mudrak added a comment - OK Helen, thanks for the advise. As I did not follow guidelines, this can't be considered bug anymore. Therefore I am resolving. However if Eloy finds time to check the MediaWiki error log I would like to know the exact reason of this.
Hide
David Mudrak added a comment -

Jordan, can we delete [[Image:Moodle_Workshop_2.0.png]] from wiki docs pernamently? It produces a blank page when trying http://docs.moodle.org/en/Special:Search?search=workshop&fulltext=Search with "Images" namespace included. Thanks

Show
David Mudrak added a comment - Jordan, can we delete [[Image:Moodle_Workshop_2.0.png]] from wiki docs pernamently? It produces a blank page when trying http://docs.moodle.org/en/Special:Search?search=workshop&fulltext=Search with "Images" namespace included. Thanks
Hide
Jordan Tomkinson added a comment -

I have deleted the file.

It seems the high resolution of the image is causing Bitmap.php to hit the php memory limit.
see http://www.mediawiki.org/wiki/Project:Support_desk/Archives/Uploading/002#.28RESOLVED.29_Error-Message_after_Uploading
Its a known bug, and apparently fixed in version 1.13.3 (we are currently 1.13.5) so it should not be happening.

There are two solutions to this;

1) Increase allowed memory limits inside PHP
this is a strange one because the memory limit is already 512M and the apache error log claims the limit for Bitmap.php is 25165824 bytes (24MB) - I cannot find where its getting that limit from.

2) reduce the resolution of your image, or break it up into smaller files.
This may be the easiest option, for us anyway. =)

Show
Jordan Tomkinson added a comment - I have deleted the file. It seems the high resolution of the image is causing Bitmap.php to hit the php memory limit. see http://www.mediawiki.org/wiki/Project:Support_desk/Archives/Uploading/002#.28RESOLVED.29_Error-Message_after_Uploading Its a known bug, and apparently fixed in version 1.13.3 (we are currently 1.13.5) so it should not be happening. There are two solutions to this; 1) Increase allowed memory limits inside PHP this is a strange one because the memory limit is already 512M and the apache error log claims the limit for Bitmap.php is 25165824 bytes (24MB) - I cannot find where its getting that limit from. 2) reduce the resolution of your image, or break it up into smaller files. This may be the easiest option, for us anyway. =)
Hide
Jordan Tomkinson added a comment -

Upon further inspection mediawiki has a setting in LocalSettings.php to force memory down to 24M
I will discuss this with MD before making changes

Show
Jordan Tomkinson added a comment - Upon further inspection mediawiki has a setting in LocalSettings.php to force memory down to 24M I will discuss this with MD before making changes
Hide
Jordan Tomkinson added a comment -

successfully tested memory increase to 50MB on the test docs site by uploading your image
I have increased the memory limit on the production wiki to 50MB

Show
Jordan Tomkinson added a comment - successfully tested memory increase to 50MB on the test docs site by uploading your image I have increased the memory limit on the production wiki to 50MB

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: