Icon problem on moodle.org

Icon problem on moodle.org

by Martin Dougiamas -
Number of replies: 11
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
We're seeing an occasional problem here on moodle.org that has me stumped.

All profile images that get served by script, eg:



will occasionally refuse to show up in the browser for the whole of moodle.org (you just see a text string or broken image). But if you download it using wget or something and then view it locally it works fine. The image data itself is fine!

More info:
  • Same thing happens to demo.moodle.org which is on another virtual host under the same machine.
  • HTTP Headers look the same when it works and when it doesn't.
  • When it happens if affects everybody using the site.
  • It's not gzip compression (it's off)
  • It's not eaccelerator (I turned it off)
  • It's not Moodle code (because it suddenly fixes itself after half an hour or so).
  • Restarting apache has no effect


Any body got any clues?

Average of ratings: -
In reply to Martin Dougiamas

Re: Icon problem on moodle.org

by Dan Poltawski -
We were mystified by it here too, doing a diff of the two images the differences were that the broken image had a newline at the start of the image and the good image had a 0xd9 byte at the end...
In reply to Dan Poltawski

Re: Icon problem on moodle.org

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Interesting! Good clue!

But how did you download it? Perhaps wget cleaned it up? Here is what I got when it was "broken":



and not broken:


In reply to Martin Dougiamas

Re: Icon problem on moodle.org

by Dan Poltawski -
I downloaded the good one with wget.

My colleague had a theory that the final byte could be being ignored by browser due to the additional byte used by newline throwing it over the content length?

No idea though..
In reply to Dan Poltawski

Re: Icon problem on moodle.org

by Mathieu Petit-Clair -
Picture of Core developers Picture of Moodle HQ Picture of MoodleCloud team Picture of Plugin developers Picture of Testers
I'd go with this.. but .. where is this newline coming from? It fixes itself after half an hour.
In reply to Martin Dougiamas

Re: Icon problem on moodle.org

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Ask your hosting company? Any infrastructure change (routers, switches, firewalls, proxies, filters...) can have caused the intermittent problem?

Just one idea, ciao smile
In reply to Martin Dougiamas

Re: Icon problem on moodle.org

by Mauno Korpelainen -

I have no clues but maybe your server has some conflict with slash arguments (I don't know what it could be...) Mouse right click over some broken images told for example that

http://moodle.org/user/pix.php/120901/f2.jpg was not visible (Bente) but
http://moodle.org/user/pix.php?file=/120901/f2.jpg was visible

http://moodle.org/user/pix.php/504/f2.jpg was not visible (Art) but
http://moodle.org/user/pix.php?file=/504/f2.jpg was visible

http://moodle.org/user/pix.php/39680/f2.jpg was not visible (Julian) but
http://moodle.org/user/pix.php?file=/39680/f2.jpg was visible...

The images are broken only in my IE7 - not in Firefox, Safari or Opera.

In reply to Mauno Korpelainen

Re: Icon problem on moodle.org

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Thanks Mauno! Very interesting! I'll play with that next time it happens.
In reply to Martin Dougiamas

Re: Icon problem on moodle.org

by Matt Gibson -
I had something similar a week or two ago, but an apache restart fixed it.
In reply to Martin Dougiamas

Re: Icon problem on moodle.org

by Lee Howard -
I just installed Moodle to try it out and noticed this problem. Thought it might be a config problem so I started digging into it. Initially I found using fiddler that a space and newline had been inserted before the image data. I don't know for sure where it is being inserted, but I found that in my case it was somewhere before the send_file() call in lib/pix.php. So I put an ob_clean() call right before the send_file() call in lib/pix.php( line 24 ) and now I get images.
In reply to Lee Howard

Re: Icon problem on moodle.org

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I am having the same problem.

Where is the lib/pix.php file that you mention? Is it in the moodle subdirectory, or is it on the Apache server?

The code works for me, but I only have access to the moodle files in order to make changes.

Any ideas about getting moodle to change from using to would be appreciated.


I might soon be upgrading to PHP5. Might this help?
In reply to Martin Dougiamas

Re: Icon problem on moodle.org

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
My two cents.
Of course I have no idea about what can be the origin of this problem but let me add my two cents of information.
I dragged (with firefox 3) from my moodle profile
http://moodle.org/user/view.php?id=76222&course=5
the jpg of my children (I missed it on my local computer) and the downloaded file was corrupted.
By copying the path of the picture
, opening a new browser window and pasting the URL I got the correct jpg.
(Try it by yourself to believe me!!!)
So the problem is not concerning icons, only!

Creating the same conditions and performing the same experiment with latest M19 using my local MAC computer as web server, I had no problem even by dragging the picture directly to the desktop.

Creating the same conditions and performing the same experiment with latest M19 using a far debian server, I had no problem even by dragging the picture directly to the desktop.

That is all.