0

I am working on a Java Swing client for JIRA REST API.

Most of the work is done, and I'm now giving the UI a final touch, and I'm having trouble to view the icons/avatars of users, projects and issue types.
The REST service does provide an API for acquiring the avatars, but I can only download them as svg format, which is not usable with swing, AFAIK.

I am familiar with libraries / executables such as batik and jmagick, but using these 3rd party, platform dependent, heavy weighted tools for such low priority UI issue seems to me like an overkill.

Since the client might not have access to the internet (for users of local JIRA servers), online conversion services are also ruled out.

Is there some other simple way to convert SVG to a Swing compatible format? I was thinking maybe there's a Swing component that handles rendering SVG's, or a very simple and light library/open source code/command line tool that only handles rendering. I am also open to ideas using a specific browser installed on the client machine (if there's any way to silently load a download page in chrome to get a png file, that would be great).

Elist
  • 5,313
  • 3
  • 35
  • 73
  • Solution IF external if external libraries where allowed: https://stackoverflow.com/questions/8167977/how-to-convert-svg-into-png-on-the-fly – Ferrybig Jan 08 '16 at 08:49
  • @Ferrybig - Batik Swing components might have been a great solution, but the batic binaries weight ~16MB, which I can't afford to add to my distributed product... – Elist Jan 08 '16 at 08:54
  • 1
    You can try to use [SVG Salamander](https://svgsalamander.java.net/). I don't know whether it works and API looks a little bit strange, but the Jar is only 300KB. – Sergiy Medvynskyy Jan 08 '16 at 09:28
  • 1
    SVGs not a "simple" format. I use Batik, but I think you can find a "smaller" version around if you look. Personal I use a implemented presented [here](http://www.pushing-pixels.org/2008/08/24/flamingo-svg-trancoder-enhancements.html) – MadProgrammer Jan 08 '16 at 09:59
  • thanks @SergiyMedvynskyy, SVG Salamander looks perfect for me – Elist Jan 08 '16 at 10:13
  • @MadProgrammer - I aware it isn't simple, but for my needs I assumed there's something smaller then batik, that handles animation, transparency, large scales and other features I don't need for this project. – Elist Jan 08 '16 at 10:15

0 Answers0