RPTools.net

Discussion and Support

Skip to content

It is currently Sun Nov 19, 2017 10:41 am 




Forum rules


Posting now open to all registered forum users.



Reply to topic  [ 15 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Kobold
 
Joined: Wed Aug 30, 2017 7:53 am
Posts: 6
Location: Aarhus, Denmark
 Post subject: New to the Maptools codebase
PostPosted: Wed Aug 30, 2017 8:00 am 
Hey guys! My party have been using MapTools for a while now to great satisfaction, so I thought I'd look into contributing to the project! For now I've looked over the issue that attempting to embed an animated gif leads to strange (probably undefined) behavior, including crashing. I'm currently just trying to get an idea of the general structure of the software, and I'm having issues figuring out specifically where and how the HTML formatting is parsed. I've found the net.rptools.maptool.client.ui.chat.ChatProcessor class where it seems that messages pass through process(String incoming) unaltered, but trying to trace where in the chain of message processing this is happening is sorta difficult. It'd be awesome if someone more familiar with the software could help me figure out the structure of it, it's gonna take some time to figure out by myself :)

I guess I could write a bit about me; I recently graduated with a bachelor's degree in computer science from Aarhus University, and have been working with software development for 1-2 years on the side. I'm currently employed full time at a software consultant firm in Aarhus, so I've got a little experience, mostly with Java, but also with a bunch of other languages and paradigms etc. I hope I'll be able to contribute something meaningful :)


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9419
Location: Netherlands
 Post subject: Re: New to the Maptools codebase
PostPosted: Wed Aug 30, 2017 8:58 am 
Hi, welcome to the rptools forum and thank you for the offer. I'll inform the devs of your request and perhaps one of them can help.

Aarhus IRC that lies in Danmark right? Recently read an article concerning the chief moderator (Viking83) of the trump-trolling subreddit forum and the impact he had on american society. Alledgedly he lived in Aarhus.

Been a couple of times to Denmark, it reminds me a lot of my own country.

anyhoot: welcome!

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
User avatar  Offline
Kobold
 
Joined: Wed Aug 30, 2017 7:53 am
Posts: 6
Location: Aarhus, Denmark
 Post subject: Re: New to the Maptools codebase
PostPosted: Wed Aug 30, 2017 9:16 am 
wolph42 wrote:
Hi, welcome to the rptools forum and thank you for the offer. I'll inform the devs of your request and perhaps one of them can help.

Aarhus IRC that lies in Danmark right? Recently read an article concerning the chief moderator (Viking83) of the trump-trolling subreddit forum and the impact he had on american society. Alledgedly he lived in Aarhus.

Been a couple of times to Denmark, it reminds me a lot of my own country.

anyhoot: welcome!


Thanks for the welcome, and yes, it's in Denmark. Tiny city for being the second-largest city in the country, but I've always lived in or around it. The university is pretty well-known for having quality comsci courses though, which is nice. I can't talk about the trump-trolling subreddit though, I try to stay out of politics ;)
I've already posted a comment on the issue tracker under the same account name as here, for now I'm just looking through the code base trying to figure out what's what.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9419
Location: Netherlands
 Post subject: Re: New to the Maptools codebase
PostPosted: Wed Aug 30, 2017 9:21 am 
:D i wasn't expecting to discuss politics with you. It as just that I read about Aarhus last week. I've informed the devs and also saw your notice on github.

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent and
DPI.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Mon May 10, 2010 11:59 am
Posts: 1704
Location: Chicagoland
 Post subject: Re: New to the Maptools codebase
PostPosted: Wed Aug 30, 2017 9:40 am 
Welcome aboard! I don't know where that code is offhand either, I would have to dig for it as well, sorry. But I would suspect it's not just chat parsing that causes issue but also rendering on the map... Some of the image stuff is also handled in rplib, a separate project and you may need to check that one out as well from github...

_________________
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
More information here: MapTool Nerps! Fork | TokenTool Nerps! Fork
Custom TokenTool (version 1.0b33): TokenTool.exe


Top
 Profile  
 
User avatar  Offline
Kobold
 
Joined: Wed Aug 30, 2017 7:53 am
Posts: 6
Location: Aarhus, Denmark
 Post subject: Re: New to the Maptools codebase
PostPosted: Wed Aug 30, 2017 9:48 am 
JamzTheMan wrote:
Welcome aboard! I don't know where that code is offhand either, I would have to dig for it as well, sorry. But I would suspect it's not just chat parsing that causes issue but also rendering on the map... Some of the image stuff is also handled in rplib, a separate project and you may need to check that one out as well from github...


What I was thinking was that if I could follow the flow of events upon posting a message to the chat (at least locally), I'd find a point where it would make sense to look at what type of image it is, and reject it if it's animated, but the flow of events is a bit of an ordeal to track... I think a general overview of how MapTools works would help me quite a bit though.


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12103
Location: Tampa, FL
 Post subject: Re: New to the Maptools codebase
PostPosted: Wed Aug 30, 2017 9:59 am 
Welcome to RPTools!

All images go through the AssetManager, IIRC. That means that any GIF loaded by MT that has to be used anywhere would be processed by that class. I would suggest setting a breakpoint in the code that loads and/or retrieves images and watch it get hit the first time the image is used. (And if I've got the name wrong, there are two other ways to determine which class it is: follow the code for the asset:// URL handler, or the code that loads tokens from .token files since images have to be added to the cache when that happens.)

In terms of why it might crash, my fix would be to check any loaded GIF and if it appears to be an animated GIF, only keep the first frame and throw the other frames away. Then have the AssetManager cache that single frame so in the future only the single frame version is returned. This means that animated GIFs from the web would also work when dragged and dropped onto MT, since it's the AssetManager (or one of its related classes) that creates the cache under .maptool.

Such a fix would mean animated GIFs would work in the chat window an and also as tokens when dropped on a map, and their thumbnail would show up correctly in the Library panel.


Top
 Profile  
 
User avatar  Offline
Kobold
 
Joined: Wed Aug 30, 2017 7:53 am
Posts: 6
Location: Aarhus, Denmark
 Post subject: Re: New to the Maptools codebase
PostPosted: Wed Aug 30, 2017 10:18 am 
Azhrei wrote:
Welcome to RPTools!

All images go through the AssetManager, IIRC. That means that any GIF loaded by MT that has to be used anywhere would be processed by that class. I would suggest setting a breakpoint in the code that loads and/or retrieves images and watch it get hit the first time the image is used. (And if I've got the name wrong, there are two other ways to determine which class it is: follow the code for the asset:// URL handler, or the code that loads tokens from .token files since images have to be added to the cache when that happens.)

In terms of why it might crash, my fix would be to check any loaded GIF and if it appears to be an animated GIF, only keep the first frame and throw the other frames away. Then have the AssetManager cache that single frame so in the future only the single frame version is returned. This means that animated GIFs from the web would also work when dragged and dropped onto MT, since it's the AssetManager (or one of its related classes) that creates the cache under .maptool.

Such a fix would mean animated GIFs would work in the chat window an and also as tokens when dropped on a map, and their thumbnail would show up correctly in the Library panel.


Awesome, thanks for the hints! I'll take another look at it tomorrow, gotta go work out and then crash! Nice to meet you all :D


Top
 Profile  
 
User avatar  Offline
Kobold
 
Joined: Wed Aug 30, 2017 7:53 am
Posts: 6
Location: Aarhus, Denmark
 Post subject: Re: New to the Maptools codebase
PostPosted: Thu Aug 31, 2017 7:12 am 
Azhrei wrote:
Welcome to RPTools!

All images go through the AssetManager, IIRC. That means that any GIF loaded by MT that has to be used anywhere would be processed by that class. I would suggest setting a breakpoint in the code that loads and/or retrieves images and watch it get hit the first time the image is used. (And if I've got the name wrong, there are two other ways to determine which class it is: follow the code for the asset:// URL handler, or the code that loads tokens from .token files since images have to be added to the cache when that happens.)

In terms of why it might crash, my fix would be to check any loaded GIF and if it appears to be an animated GIF, only keep the first frame and throw the other frames away. Then have the AssetManager cache that single frame so in the future only the single frame version is returned. This means that animated GIFs from the web would also work when dragged and dropped onto MT, since it's the AssetManager (or one of its related classes) that creates the cache under .maptool.

Such a fix would mean animated GIFs would work in the chat window an and also as tokens when dropped on a map, and their thumbnail would show up correctly in the Library panel.


I've looked into this now. So far it seems that the images in the chat do not pass through any of the createAsset() or getAsset() functions... I'll keep searching


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3483
Location: Austin, Tx
 Post subject: Re: New to the Maptools codebase
PostPosted: Wed Sep 06, 2017 9:18 am 
Thanks for taking this on. It's been an oft requested bit of functionality. It will be nice to have it working properly.

Plus - you can use an animated gif on a token? I never knew that.

_________________
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Sun Feb 25, 2007 11:53 am
Posts: 3773
Location: MD
 Post subject: Re: New to the Maptools codebase
PostPosted: Wed Sep 06, 2017 2:08 pm 
RPTroll wrote:
Plus - you can use an animated gif on a token? I never knew that.

You can't. ;)

At least, not yet.

_________________
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3483
Location: Austin, Tx
 Post subject: Re: New to the Maptools codebase
PostPosted: Wed Sep 06, 2017 5:53 pm 
MapTool would a lot cooler if you could.

_________________
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7947
Location: Bay Area
 Post subject: Re: New to the Maptools codebase
PostPosted: Wed Sep 06, 2017 7:36 pm 
You can show animated gifs in other parts like chat or frames but you will need to reference an external url.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
TheBard
 
Joined: Tue Mar 21, 2006 7:26 pm
Posts: 3483
Location: Austin, Tx
 Post subject: Re: New to the Maptools codebase
PostPosted: Wed Sep 06, 2017 8:11 pm 
I also didn't know you could reference external URLs in frames. Geeze. I've been gone too long.

_________________
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image


Top
 Profile  
 
User avatar  Offline
Kobold
 
Joined: Wed Aug 30, 2017 7:53 am
Posts: 6
Location: Aarhus, Denmark
 Post subject: Re: New to the Maptools codebase
PostPosted: Fri Sep 08, 2017 2:43 am 
The entire issue right now seems to be that whatever is rendering images is sorta bad at animated gifs, some will show, some will cause a stack overflow, and some will freeze the entire program. For now the proper solution seems to be either displaying the error picture, or displaying only the first frame of the gif. I still haven't figured out where the frak embedded images pass through though...


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 15 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 2 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman