Tilebmpfile is coming as null

i am trying to write a solution using the tiled library for java but Library 1.2 version wasn’t printing tileID correctly so i switched to 1.4 where it had many issues because it was Saving wrong TilesetPath in TMX and TSX both where it was not detecting absolute path because of "file:" was inside the path string
i have fixed that personally in the source code and generated a new jar the issue was fixed

But now i am getting another issue the Tilebmpfile is coming as null in the latest java library for tiled i’ve tried multiple fixes in the reader but i think i am missing something because the issue was not fixed so can anyone tell me a quick fix for this? i believe its not detecting the URL as absolute again similar as the previous issue that’s why its saving Tileset Image file as null but its really problematic for me can anyone please assist me with this issue?
PS: This issue was not present in 1.2 BMP file was coming just file

tilesetImageFile = ImageIO.read(new File(tileset.getTilebmpFile());


I’m afraid libtiled-java is currently without a dedicated maintainer. If you have made any fixes however, you’re welcome to open a pull request for review. There have been several people making improvements and fixes to this library in the past year which could help verify the change.

getTilebmpFile is implemented as follows:

Since File.getCanonicalPath is not documented to ever return null, the tilebmpFile member must be null in your case. This would mean the following function is never called, or called with null:

That function is only called from the String version of importTileBitmap. When the URL version has been used, tilebmpFile is never set. So, this problem appears to have been caused by the following change:

Would you be able to provide a patch, that makes sure to set tilebmpFile as appropriate for the URL version of importTileBitmap? I’m not sure what’s the best way to handle this, but it seems to me like setTilesetImageFilename could just be changed to take a URL and use it to construct the File using new File(url.toURI()). I’d suggest to rename it to setTilesetImageURL and keep setTilesetImageFilename taking a String for compatibility.