Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Incompatibility with the "Randomize Wildcard Images" option #79

Open
dovahkiin22836 opened this issue Sep 6, 2021 · 6 comments
Open
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@dovahkiin22836
Copy link

Environment Details

  • Foundry VTT Version: 0.8.9
  • Operating System: Windows 10
  • How Are You Using Foundry: Native Application (Electron)
  • Which Game System: dnd5e v.1.4.2
  • Modules Enabled?: yes (79)

Issue Description

Whenever an Actor has the token image path ending with ' /* ' in order to use the randomize wildcard images functionality, chat portrait does not recognize the path

@p4535992
Copy link
Collaborator

p4535992 commented Sep 6, 2021

It's working for me , maybe some module incompatibility ?
There is any exception on the web console ?

@dovahkiin22836
Copy link
Author

dovahkiin22836 commented Sep 6, 2021

I can confirm that with 0 modules enabled but Chat Portrait it fails to find any image if the folder path ends with /* (using Chat Portrait v.0.5.10)

@p4535992
Copy link
Collaborator

The module setting "Use Token Image" is enabled ?

Tested with these path on the prototype token configuration:

systems/dnd5e/tokens/humanoid/*
systems/dnd5e/tokens/fiend/*.png

@dovahkiin22836
Copy link
Author

dovahkiin22836 commented Sep 12, 2021

The setting is enabled.
I also tested with the systems/dnd5e/tokens/humanoid/*, (no other modules enabled) and the chat image still doesn't load.
Though I noticed, when I click on the "browse files" to switch back the token image path a yellow warning pops up:

"Directory [token image path] does not exist or is not accessible in this storage location"

....could it be a core issue then? can you reproduce?

edit: when testing the systems/dnd5e/tokens/fiend/*.png the yellow warning does not pop up, yet the chat image loads the portrait image instead of the token image

@p4535992
Copy link
Collaborator

p4535992 commented Sep 12, 2021

Sorry man i can't reproduce...
There is any error on the web console ? If you using Chrome or Window Application use "Ctrl + Shift + I" and tell me if there is any error.
If you are using Windows Chromium application make sure to start the app with "Run as Administrator", maybe is just a permisisons issue because the images are in the C disk of windows.

@Pellanor
Copy link

Pellanor commented Oct 18, 2021

I'm seeing the same issue with wildcard images.

I was poking around in the debugger a bit and came across this method. It will only match /*.extension it won't match /* or /prefix_*.extension.

    static isWildcardImage(imgUrl) {
        const filename = imgUrl.split('/').pop();
        const baseFileName = filename.substr(0, filename.lastIndexOf('.'));
        return baseFileName == '*';
    }

When I try any of those formats I get the following error in the console (with the url containing whatever wild cards string I'm using).

*:1 GET http://127.0.0.1/icons/svg/* 404 (Not Found)
Image (async)
  | generatePortraitImageElement | @ | ChatPortrait.js:901
  | onRenderChatMessageInternal | @ | ChatPortrait.js:218
  | onRenderChatMessage | @ | ChatPortrait.js:138

--- edit ---

I seem to have a further issue above and beyond this . When I get isWildcardImage to pass, I'm still just getting the actor image instead of the token image. It looks like speaker.token is always null when PreCreateChatMessage is off. Once enabled it is not null for the GM when on the scene with the token, but it is still null at all other times. I'm using the SotDL system, which I know hasn't been tested, so that could be the culprit.

@p4535992 p4535992 added the bug Something isn't working label Nov 8, 2021
@p4535992 p4535992 added the help wanted Extra attention is needed label Apr 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants