Views

MyMobileWeb ImageTranscoder

From Morfeo Wiki

Jump to: navigation, search

Contents

Introduction

MyMobileWeb platform contains a component called MyMobileWeb Transcoder, which includes the following features:

  • Image resizing respect device's display size.
  • Image conversion to fit the format needed by target device.

Configure

To use this component, the application classpath must contain the following 3rd party libraries:

  • jai_codec.jar
  • jai_core.jar
  • mlibwrapper_jai.jar
  • WBMPMaster103.jar
  • mymw-transcoder.jar
  • jcr-1.0.jar
  • batik-transcoder.jar
  • batik-awt-util.jar
  • batik-bridge.jar
  • batik-dom.jar
  • batik-ext.jar
  • batik-extension.jar
  • batik-gui-util.jar
  • batik-gvt.jar
  • batik-parser.jar
  • batik-script.jar
  • batik-svg-dom.jar
  • batik-svggen.jar
  • batik-swing.jar
  • batik-xml.jar
  • js.jar


All transcoder configuration is set in MyMobileWeb-Global.xml and MyMobileWeb.ImageTranscoder.xml (both obligatory).

MyMobileWeb.ImageTranscoder

  • Property Cache_Work_Directory
    All transcoded images are saved to disk to gain in efficiency. This way the next time they are needed, new processing is avoided and they are just read from the disk. This property sets the directory where all these processed images are saved.

    <property name=”Cache_Work_Directory” value=”temp/images”/>

Image:cfg_image_transcoder_xml.gif

Figure 1 .- MyMobileWeb.ImageTranscoder.xml configuration


MyMobileWeb.Global

  • Property Plugin_Class
    Sets the full qualified name of the class implementing the Image Transcoding abstract interface. MyMobileWeb provides the plugin org.morfeo.tidmobile.transcoder.TidImgTranscodingPlugin. If the user decides to use another image transcoding component, he must implement the interface org.morfeo.tidmobile.transcd.ImgTranscodingPlugin and specify his own class in the property.

    <property name=”Plugin_Class” value=” org.morfeo.tidmobile.transcoder.TidImgTranscodingPlugin”/>

  • Property URL_Trans_Img

    If the path defined in the property Cache_Work_Directory is absolute, URL_Trans_Img must be set indicating the base URL used to generate image full URLs.

    <property name=”URL_Trans_Img” value=”http://servlet?{0}”/>


Image:cfg_mymobile_global_xml.gif

Figure 2 .- MyMobileWeb.Global.xml configuration

CSS properties

The transcoder plugin details are controlled by the following style properties:

  • transcode property, boolean variable that stays whether transcoding should be applied to specified image or not.
  • weight-width property, weight of the width of the image respect display's width.
  • weight-height property, weight of the height of the image respect display's height.


Image:css_image_transcoder.gif

Figure 3 .- CSS properties example.

Download

  • MyMobileWeb Transcoder can be downloaded from the following URL: [1]
  • MyMobileWeb_AdvancedControls with transcoding example: [2]