Corrupted images in IE

Corrupted images in IE

by Robert Byerly -
Number of replies: 3
Due to a failing piece of hardware, we had to re-install WeBWorK (and in fact, an entire operating system) in the middle of a semester. Fortunately things went fairly smoothly and we only had one morning of down-time.

More specifically, our previous server ran version 2.3 on Ubuntu 5.10. After the hardware repairs we completely re-installed the operating system (to Ubuntu 7.10) and completely re-installed WeBWorK (version 2.4). After testing, we then wiped the newly created webwork database in mysql and the course subdirectory, restored the webwork database from a mysqldump of our old installation and the course subdirectory, and ran wwdb_upgrade. Things appeared to work fine. Note that since the WeBWorK installation was new, no image files were being carried over from the previous installation.

Our default display mode is "images" and the only allowed display modes are "images" and "jsMath".

Some students started complaining that they could not see equations. The images were blurry and unreadable. This only seems to affect some (not all) users of Internet Explorer. (I know that version 6.0 is affected while version 7 is not.) Things are fine in Firefox and Safari.

I'm going to attempt to attach a screen shot (below) a student sent one of our instructors showing the problem.

As a work-around, I've been suggesting that people switch to jsMath if they can't see the images. This works for some people (and some problems) but I notice from other posts that some versions of IE may have trouble with jsMath too. Also jsMath doesn't render some TeX macros (e.g. the \dfrac macro from amsmath, which appears in a number of our problems.)

Suggestions are appreciated.


Bob Byerly


In reply to Robert Byerly

Re: Corrupted images in IE

by Michael Gage -

I'd make a couple of tests to see what is going on.

It's possible that the browser has some kind of imperfect cache of the equation pictures. Holding down the shift key while clicking refresh or reload will force the browser to fetch a new copy of the equation pictures. You could also ask the students to clear the cache of their browser and see if that helps.

The other information is to find out url of the equation picture and load it
into a separate page (right click gives you a menu that allows you to do this in some browsers -- otherwise you can inspect page source). See if that address seems recognizable. On the server side you can check to see if the file is there, delete it and then force it to be recreated.

You may have already done all of these things, but if not this will give you a bit more information to work with.

-- Mike
In reply to Michael Gage

Re: Corrupted images in IE

by Robert Byerly -
Hi Mike,

After trying all the things you suggested, it occurred to me to take a closer look at our version of dvipng. The installation manual for WeBWorK 2.4 said that WeBWorK was already configured to work with versions of dvipng >= 1.0, so I hadn't thought about this. However, I took a look at lib/WeBWorK/ and saw that the configuration parameters for versions of dvipng >= 1.6 are different. I edited, deleted old images, and restarted the web server, and this seems to have fixed it.

I should have read the comments in more carefully. Perhaps the installation manual for WeBWorK could mention this issue. I'm sure it will bite someone else.

Thanks for your suggestions.


In reply to Robert Byerly

Re: Corrupted images in IE

by Davide Cervone -
You mention that jsMath doesn't process some macros like \dfrac. These are part of the amsmath LaTeX package, and jsMath does handle those, but they are not loaded by default. It would be possible to request jsMath's AMSmath extension to be loaded for all problems, or to define the macros you are most interested in so that they autoload the AMSmath extension.

The first could be accomplished by editing the webwork2/htdocs/jsMath/jsMath-ww.js file and adding

    Setup: {
      UserEvent: {
        "onload": function () {jsMath.Extension.Require("AMSmath")}
after the line reading
    Font: {},
This would cause the AMSmath extension to be loaded for every problem for every class (but since the file should be cached by the browser, that is not such a big deal). I should add a variable in global.conf that gives an array of extensions to load automatically to make this easier for you.

To predefine \dfrac to autoload the AMSmath extension, add

    dfrac:       ['Extension','AMSmath'],
after the line
    boldsymbol:  ['Macro','{\\bf #1}',1],
This would define \dfrac so that it would load the AMSmath package only when \dfrac is actually used in the problem. Other macros can be added in the same fashion.

It would be possible to make these changes on a course-by-course, or even problem-by-problem basis, but it would take a little care.

Hope that helps.