MrPrimate / tokenizer

Tiny yet capable in-game token editor for Foundry VTT
MIT License
29 stars 26 forks source link

Pasting an image URL from 2e AONprd website as layer in Tokenizer does not work. #107

Closed chaoticnote closed 1 year ago

chaoticnote commented 1 year ago

Program: Foundry VTT, version 10 build 291 Game System: Pathfinder Second Edition (Official), v4.4.2 Tokenizer version 3.9.5

Steps Taken:

  1. Open a World with the PF2e system.
  2. Open an Actor's sheet from any of the PF2e compendium.
  3. Click on Avatar section, which opens Tokenizer for that Actor's sheet.
  4. Disable the "Modify Token Only?" option.
  5. Attempt to Add Layer using a URL of an image from https://2e.aonprd.com/ on Avatar side.

In my case, I've tried modifying the Wolf sheet's avatar by uploading an image URL of the Wolf picture from the 2e Archives of Nethys website. However, it does not upload the image. Doing the same on the Token side of the Tokenizer has no results either. Unlocking the compendium it's in or importing the compendium to the Actors tab also does not fix the issue. However, when I upload any other image URL from, say, a wolf image from Wikipedia, that works just fine. I'd like to know why specifically uploading image URLs from the 2e AONprd website does not work and if this could be fixed somehow.

chaoticnote commented 1 year ago

Also tried with a Deviant Art image URL and from Pinterest. Does not work as well.

chaoticnote commented 1 year ago

Opened Console to see what's going on.

commons.js:1703 Error: You are accessing the NPCPF2e#data object which is no longer used. Since V10 the Document class and its contained DataModel are merged into a combined data structure. You should now reference keys which were previously contained within the data object directly. at logCompatibilityWarning (commons.js:1692:19) at NPCPF2e._logV10CompatibilityWarning (commons.js:6642:14) at get data [as data] (commons.js:6542:24) at tokenizeActor (hooks.js:104:17) at tokenizeDoc (hooks.js:142:5) at HTMLImageElement. (hooks.js:283:15) at HTMLImageElement.dispatch (jquery.min.js:2:43064) at y.handle (jquery.min.js:2:41048)

Foundry VTT | Rendering Tokenizer

Access to image at 'https://2e.aonprd.com/Images/Monsters/Drake_ShadowDrake.png?1670775195258' from origin 'http://localhost:numbershere' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

2e.aonprd.com/Images/Monsters/Drake_ShadowDrake.png?1670775195258:1 GET https://2e.aonprd.com/Images/Monsters/Drake_ShadowDrake.png?1670775195258 net::ERR_FAILED 302

logger.js:63 Tokenizer | ERR > Download listener error Event {isTrusted: true, type: 'error', target: img, currentTarget: img, eventPhase: 2, …}

logger.js:63 Tokenizer | ERR > Error fetching image Event {isTrusted: true, type: 'error', target: img, currentTarget: img, eventPhase: 2, …}

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'error') [Detected 1 package: vtta-tokenizer] at Tokenizer.js:404:39

MrPrimate commented 1 year ago

This is a dupicate of https://github.com/MrPrimate/tokenizer/issues/26 please try copy-pasting the image instead. (You can use ctrl-v to paste the image into tokenizer).