eXaminator / kanka-foundry

FoundryVTT module to import information from kanka.io
MIT License
22 stars 8 forks source link

Possible Bug - Exception when load characters with image loaded by url on Kanka #65

Closed p4535992 closed 2 years ago

p4535992 commented 2 years ago

Environment Details

Foundry VTT Version: 0.8.8

Operating System: [Linux]

How Are You Using Foundry: [Linux,Native Application (Electron), Chrome]

Which Game System: Dungeons and Dragons 5th Edition, version 1.3.6

Modules Enabled?: Yes (if you need i can give you the full list)

Module version: 3.2.1

OS, Hosting, Browser (if applicable): Linux/Node/Chrome

Description of the issue:

So I checked the bug with the 'Characters' category, but it might be present in the others as well.

Kanka provides two methods to upload images either by uploading from a local image or via web url.

In the first case everything works perfectly in the second when I make the 'link' of the character (with the image retrieved from a web url on Kanka) I import it successfully, but without the image, if I click on the 'update' it gives me an exception that I report below.

byg

It's strange because I don't understand at the import level what can change, in both upload cases Kanka should create her own web link for the entity in question.

This is one of the url generated by Kanka that gives the error:

https://images.kanka.io/user/k9UFBC3o61jsoxuMoTCKJDEnn00=/smart/src/characters%2F60fc48a705efd_qoh1hnwpng?webpfallback

as you can see the ".png" extension is "hidden" with the text '' nwpng "which is the cause of the error, the browser then realizes that it is a valid image and displays it correctly if you use the link.

eXaminator commented 2 years ago

Oh, very interesting! Thanks for bringing this up. I have to investigate how / why kanka creates these URLs without those file endings. I might have to bring this up on the kanka discord or ignore these cases, because it seems foundry expects a valid file ending when setting the image of a journal entry.

I'll have to investigate this further. Thanks again!

eXaminator commented 2 years ago

I checked this with the Kanka team. This is currently a bug with images imported via URL. They will fix this with the next Kanka release, but only for new images. Images that are already broken (which are missing the proper file extension) won't be fixed. So to be able to properly import them you'll have to add the images again after the next update of their platform.

One "easy" way would be to download the image from kanka and upload it as a new image for the broken entity. You could probably already do this now to fix them, as uploaded images don't seem to be problematic in that regard right now.

I'll close the issue now as there doesn't seem to be anything else I could do on my end to fix this as this right now. Thanks for bringing this to my attention!

p4535992 commented 2 years ago

Ty for the info , very fast !