This document is the starting point for learning about the Graphics Conversion service. The following topics are covered:
The Graphics Conversion service provides a server-side JAX-RS resource that supports scaling and conversions to and from many graphics formats. See the conversion chart for details.
From/To | GIF | JPEG | PNG | TIFF | GFX | |
---|---|---|---|---|---|---|
GIF | Yes | Yes[1] | No | Yes[1] | No | No |
JPEG | Yes[1] | Yes | No | Yes | No | No |
--- | --- | --- | --- | --- | --- | |
PNG | Yes[1] | Yes | No | Yes | No | No |
SVG | No | Yes | Yes | Yes | Yes | Yes[2] |
TIFF | --- | --- | --- | --- | --- | --- |
[1] Supported only with Java SDK Version 6.0 or higher.
[2] There are currently limitations in the scope of SVG to GFX function. See the Limitations section.
A sample client application, provided via the Mobile Showcase sample, illustrates a simple Ajax invocation of the Graphics Conversion service. The Mobile Showcase sample is available in the WAS 8.5 samples infocenter.
Product prerequisite | Version |
---|---|
Java Technology Edition | 5.0 and later |
|
WebSphere Application Server Version 8.5r |
Web browser | Any modern web browser, such as: Internet Explorer 7 and later Mozilla Firefox 3.x and later Google Chrome Safari Opera |
To use the Graphics Conversion service, deploy the service .ear file to an application server. Read about Installing the Graphics Conversion service.
After the service is deployed, you can use the client demo provided. The demo is available at:
http://<server>:<port>/appsvcs-graphics/
Try different values in the various input fields to see the converted images.
To directly generate dynamic image conversions in your browser, you can also enter a URL with the parameters that you specify; for example,:
http://<server>:<port>/appsvcs-graphics/rest/graphics/convert/binaryResponse?sourceUrl=<graphic_file_url>&desiredFormat=<new_format>&maxWidth=<optional_width>&maxHeight=<optional_height>
Note working files and converted files returned via URL-reference are stored in a temporary directory location which is specified by the resultsTmpDir configuration parameter that is declared in an initialization parmater of the web.xml file. The following portion of web.xml file demonstrates its use:
... <init-param> <!-- Set the following property to the full path where you want newly scaled and converted images to be saved. --> <!-- For example, on Linux/Unix: /tmp --> <!-- For example, on Windows: c:\temp --> <!-- When no value is specified, the default is the "javax.servlet.context.tempdir" ServletContext attribute set by the web container. --> <!-- When the special string java.io.tmpdir is specified, the service uses the Java system property with key "java.io.tmpdir" --> <param-name>com.ibm.ws.mobile.appsvcs.graphics.resultsTmpDir</param-name> <param-value>java.io.tmpdir</param-value> </init-param> ...
This section describes the procedure for installing the Graphics Conversion service into Version 8.5 of the IBM WebSphere Application Server. It is assumed that you are familiar with application installation and administration for the application server.
Locate the Graphics Conversion service enterprise archive (EAR) file that is provided with your product installation. You can find the EAR file in your installation tree where you installed the IBM WebSphere Application Server Web 2.0 and Mobile Toolkit. For example, if you installed the toolkit in the following location:
Platform | Location |
---|---|
Linux and UNIX: | /opt/WebSphere/Web20Mobile |
Windows: | c:\WebSphere\Web20Mobile |
Then you can find the EAR file at:
Platform | Location |
---|---|
Linux and UNIX: | /opt/WebSphere/Web20Mobile/installableApps/application_services/graphics/appsvcs-graphics.ear |
Windows: | c:\WebSphere\Web20Mobile\installableApps\application_services\graphics\appsvcs-graphics.ear |