maptool icon indicating copy to clipboard operation
maptool copied to clipboard

[Bug]: Red X semi-consistently displayed for assets

Open icarean opened this issue 2 years ago • 2 comments

Describe the Bug

Unsure whether this is a single problem manifesting in different ways, or three different but related problems. I'm logging as a single bug for now.

For each time I restart MapTool, if an image happens to display correctly then it will continue to display correctly for the remainder of the time that instance of MapTool is open (so I guess that's the way the cache works). But once an image displays an X it will continue to display an X until MapTool is restarted (regardless of trying Jmr's and Full Bleed's suggestions, switching maps, or dragging the image from the library onto a background layer of the same or a new map).

I've noticed the following:

  1. MapTool deciding it can't load an image for some reason, perhaps sometimes due to running out memory (e.g. last night on a laptop running a server and client at the same time) but I think perhaps sometimes due to some other reason(s) (e.g. today only running one instance of MapTool with Java settings to allow 6GB memory on Ubuntu, or only running one instance of MapTool on a 16GB Windows desktop). I think this because the most consistent way to recreate this is to open map after map after map in my campaign until an X eventually appears on something, but clearing the cache etc doesn't seem to affect when the problem occurs.
  2. The cache system believing that, for each time MapTool is run, if an image cannot be displayed on one occasion it must not be displayable ever again, and sometimes (but not consistently) remembering this in the .cmpgn file. I think this because sometimes I can reload the campaign, go straight to a particular map, and have things display correctly, yet other times one particular map causes a problem each time I load MapTool. However, I can fix the problem by loading the .cmpgn, dragging the image from the library into any layer, and then going to that 'consistent problem' map, and seeing MapTool now displaying the image it thought it couldn't display previously.
  3. No way (that I'm aware of) for the user to force an attempt to reload an image if it has failed once, other than reload-MapTool-and-drag-drop trick described in 2. (if desired I could submit this item as a feature request)

To Reproduce

The .cmpgn file is too large (~205MB) to upload to Github (max size 25MB) or Discord (max size 50MB), so I've uploaded to a Google Drive: https://drive.google.com/file/d/1_B3TkFXFFWi7zS4PzODVqOrbRwx2Vp7c Use this .cmpgn file, follow the steps in 'describe the bug'.

Expected Behaviour

Ideally, the red X wouldn't ever appear. If/when that is unavoidable, then next-most-ideally:

  • It would be easy to identify WHY the X appeared (e.g. by hovering the mouse over, or from a right-click context menu option, wherein MapTool would give helpful info like "unable to load image due to insufficient RAM" or "unable to find asset" or somesuch).
  • It would be possible to attempt to force a reload the file (e.g. after clearing the cache).

Screenshots

No response

MapTool Info

MapTool 1.13.2, 1.14.0.rc4, and 1.14.2

Desktop

Ubuntu 23.10 and Windows 10

Additional Context

  • I was thinking this was a memory-full thing (because I was running a server and client on a laptop and switching between maps), but now I'm thinking it's perhaps something a bit more complex. I tried Jmr's suggestion (from the Discord #testing-requests-feedback channel ) and increased both stack size and maximum heap size. Same behaviour. I confirmed by move hover-over the little memory bar in the bottom right that MapTool knew it could allocate up to e.g. 6GB.
  • I tried Full Bleed's suggestion (from the Discord #testing-requests-feedback channel ) of double clicking the Asset cache (and also the thumbs cache for good measure). Same behaviour.
  • The images will sometimes display, and sometimes not. So I don't think the problem is with the .cmpgn file contents nor with the images themselves. Also, I don't think it's a simple case of the .cmpgn file being too big: Ubuntu reports it at 216.1MB and Windows reports it at 206MB, so while it's got a fair number of images etc in it but it's not massive compared with the available RAM.

icarean avatar Dec 10 '23 18:12 icarean

@icarean There have been several bugs fixed with asset corruption, and incorrect loading since this issue was rasied, are you still experiencing this?

cwisniew avatar Sep 10 '25 00:09 cwisniew

Using Maptool 1.17.1 now, and I do still have red X marks in some of my maps but it's very possible this is indicating assets corrupted/lost in earlier versions. It does seem like maps I've added more recently* are loading properly.

  • sorry I couldn't put a particularly accurate timeframe on "more recently". Certainly sometime since I filed this bug report.

So yeah it seems perhaps this has been entirely fixed? (but I can't be sure). Thanks all coders for the work on the fixes!

icarean avatar Sep 29 '25 13:09 icarean