Icon problem on moodle.org

Icon problem on moodle.org

par Martin Dougiamas,
Nombre de réponses : 11
Avatar Core developers Avatar Documentation writers Avatar Moodle HQ Avatar Particularly helpful Moodlers Avatar Plugin developers Avatar 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?

Moyenne des évaluations: -
En réponse à Martin Dougiamas

Re: Icon problem on moodle.org

par 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...
En réponse à Dan Poltawski

Re: Icon problem on moodle.org

par Martin Dougiamas,
Avatar Core developers Avatar Documentation writers Avatar Moodle HQ Avatar Particularly helpful Moodlers Avatar Plugin developers Avatar 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:


En réponse à Martin Dougiamas

Re: Icon problem on moodle.org

par 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..
En réponse à Martin Dougiamas

Re: Icon problem on moodle.org

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

Just one idea, ciao sourire
En réponse à Martin Dougiamas

Re: Icon problem on moodle.org

par 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.

En réponse à Martin Dougiamas

Re: Icon problem on moodle.org

par 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.
En réponse à Lee Howard

Re: Icon problem on moodle.org

par Rick Jerz,
Avatar Particularly helpful Moodlers Avatar 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?
En réponse à Martin Dougiamas

Re: Icon problem on moodle.org

par Daniele Cordella,
Avatar Core developers Avatar Particularly helpful Moodlers Avatar 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.