I'm midway through a Herolabs -> Maptools token importer, and had to make a non-invasive patch to PersistenceUtil.java to pull it off.
Here's my change; from:
To:public static void saveToken(Token token, String string ) throws IOException {
// Thumbnail
BufferedImage image = ImageManager.getImage( token.getImageAssetId() );
Backwards compatible for existing users; allows me to persist a token with an image gracefully. (without this change the token just shows up with the TRANSFERRING IMAGE '?' icon.)public static void saveToken(Token token, String string ) throws IOException {
saveToken( token, string, false );
}
public static void saveToken(Token token, String string, boolean doWait ) throws IOException {
// Thumbnail
BufferedImage image = null;
if ( doWait ) {
image = ImageManager.getImageAndWait(token.getImageAssetId());
}
else {
image = ImageManager.getImage( token.getImageAssetId() );
}
Can submit a patch file too if that helps.
Cheers