GUI Image Loading Error

Hello MFiX Forum,

I have downloaded the latest version of MFiX (21.4), and it seems the vector images are not loading. Specifically, all the images that have .svg file type. I have added a few images of the missing icons as well as the error message I am receiving. There appears to be a problem with the path for some reason. I have no issues using my old version of MFiX (19.2.1), and my Anaconda package is up to date. Any sugggestions?


Logo Missing
Top Tab Icons

The first image is just a small part of the error message I get in the Anaconda Prompt, the second image is showing the bottom tab on my screen where the MFiX logo should be, and the third image is the control bar above the area to view the domain and regions. You can see there should be an image in the highlighted square, but all the buttons are missing images. Below is an image of what the third image should look like from MFiX 19.2.1.

image

Hi Jason. We have not seen this type of error previously. Can you send us more info about your installation? On the main menu, ‘Submit bug report’ generates a ZIP file with more diagnostics, which you can upload here.

Thanks,
– Charles

Also, can you verify that the files are actually present and loadable? In Windows File Manager, navigate to the location ///nas01.itap.purdue.edu/.../mfixgui/images/ and see if you can click the SVG files

Hello Charles,

Thank you for responding quickly! I did navigate to the files and was able to open them individually.

Here is a zipped folder.
heater_exp_2022-02-01T182245.298953.zip (22.5 MB)

I’m noticing a mix of forward and backward slashes in the error message - your home dir is C:\Users\jshirck but MFiX is trying to load files from a location ///nas/.../images. Can you give me a little more info about how you installed Anaconda and MFiX? It looks like you installed to a network drive. This should not be a problem, but I’m wondering if it somehow is causing the issue.

– Charles

I installed both Anaconda and MFiX via the instructions given on the MFiX website. However, my machine is owned by the university, so I have to jump through a few hoops to get the things I need. For example, I have to enter an admin username and password to start downloads. I double-checked that my username has permissions to access, read, write, etc. all the files in the folder ‘mfix-21.4’. It’s curious to me that MFiX 19.2.1 has no issues, but both 21.3.2 and 21.4 do. I have not changed my download procedure (at least not that I remembered since 19.2.1 was 2 years ago).

Hi Jason. I have not been able to reproduce this problem locally but I think I see what the problem is from looking at the code. Would you be willing to help me test a fix?

If you have access to the file, open U:\personal\conda\mfix-21.4\Lib\site-packages\mfixgui\tools\qt.py in a text editor, find the function get_image_path starting at line 65, and change it from:

def get_image_path(name):
    """"get path to images"""
    path = os.path.join(SCRIPT_DIRECTORY, 'images', name)
    if os.name == 'nt':
        path = path.replace('\\', '//')
    return path

to

    """"get path to images"""
    path = os.path.join(SCRIPT_DIRECTORY, 'images', name)
    return path

That is, simply delete lines 68 and 69 which are changing backward slashes to (double?) forward ones - I believe this code was added in error. I see that it was added right after the 19.2.1 release, which worked for you, and it’s not clear why this substitution is being done.

Please let me know if that fixes the problem, if so we will make this change in the next release.

– Charles

Charles,

That has appeared to work for the most part. Nearly all of the previous images that failed to load are now clearly visible.

image

However, there is 1 image that is being a pain and still not loading. This time, however, it is due to a different type of error; see the image below. It looks like the ‘Visibility’ symbol is not showing up on the ‘Geometry’ tab.


image

Honestly, I feel much better with how it looks, and I would be fine missing only one icon. Up to you if we want to continue to find the final fault. Thank you for your time and support.

Jason - thanks for testing! I have not been able to duplicate this problem locally, so your help is valuable. (Still trying to install Anaconda on a network share - it installs, but the start menu items don’t get created).

If you can test a few more things I’m sure we can resolve this completely. This problem has not been reported before but it’s because your installation is a bit unique. However, I think installing MFiX on a network drive should be supported.

If you can do one more experiment: go back into the tools/qt.py file and change get_image_path to this:

def get_image_path(name):
    """"get path to images"""
    path = os.path.join(SCRIPT_DIRECTORY, 'images', name)
    if os.name == 'nt':
        path = path.replace('\\', '/')
    return path

Note that is a single forward slash, not the // that appeared in the original code. The double-backslash is correct (escape code).

– Charles

Charles,

That worked!! No more error messages, and I can see all of the images. I am currently trying to click on as many things as I can to trigger an error, but so far nothing. Thank you very much for your support, and I hope this helps other users in the future (and maybe in a future update).

– Jason

1 Like