Getting started with the Graphics Conversion service

This document is the starting point for learning about the Graphics Conversion service. The following topics are covered:

Overview

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 PDF PNG TIFF GFX
GIF Yes Yes[1] No Yes[1] No No
JPEG Yes[1] Yes No Yes No No
PDF --- --- --- --- --- ---
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.

Note:
  • The Graphics Conversion sample application is only to illustrate one possible use of the Graphics Conversion service, and to illustrate how one would use AJAX invocations to make the REST request.
  • Because of limitations existing in certain browsers with respect to rendering SVG content within img and iframe html tags, workarounds are sometimes used which involve rendering non-SVG image when SVG image is selected. However, this is simply for selection display purposes and is so noted within the html document. However, when the actual AJAX request is sent to the service the actual SVG image is always sent in for conversion. In the results view, you will always see the actual converted image, which can be saved if necessary.

Prerequisites:

Product prerequisite Version
Java Technology Edition 5.0 and later
Java Platform, Enterprise Edition 5
application server 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

Limitations

Security considerations

Using the Graphics Conversion service

  1. To use the Graphics Conversion service, deploy the service .ear file to an application server. Read about Installing the Graphics Conversion service.

  2. After the service is deployed, you can use the client demo provided. The demo is available at:

    http://<server>:<port>/appsvcs-graphics/
    
  3. Try different values in the various input fields to see the converted images.

  4. 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>
    

Installing the Graphics Conversion service

WebSphere Application Server installation instructions

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.

Before you begin

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

Installing the Graphics Conversion service using the administrative console

  1. Log into the administrative console for the application server.
  2. Navigate to Applications > New Application. (Note: In WebSphere Application Server Version 6.1, select Install New Application)
  3. Select New Enterprise Application. (Note: In WebSphere Application Server Version 6.1, skip this step)
  4. Browse your file system, and select the appsvcs-graphics.ear file that you located earlier. Click Next.
  5. Click Next to prepare for the application installation. (Note: In WebSphere Application Server Version 6.1, skip this step)
  6. Click Next to accept the default installation options.
  7. Click Next to accept the default options for map modules to servers.
  8. Click Next to accept the default options for Metadata for modules. (Note: In WebSphere Application Server Versions 6.1 and 7, skip this step)
  9. Click Next to accept the default options for map virtual hosts for web modules.
  10. Review the summary of the installation options.
  11. Click Finish.
  12. Click Save to the master configuration.
  13. Navigate to Applications > Application Types > WebSphere Enterprise Applications. (Note: In WebSphere Application Server Version 6.1, Navigate to Applications > Enterprise Applications)
  14. Select the IBM WebSphere Application Server - Graphics Conversion service, and click Start.

Terms of Use | Feedback