You Are Here:

Community: Wiki

This page was last modified on 3 August 2009, at 10:31.

Image service

From Forum Nokia Wiki

This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. The article is believed to be still valid for the original topic scope.
Image:FNWID.gif

Contents

The service

The image service delivers all images to the client scripts (widgets) in a format that is supported in the mobile terminal.

In the usual case, images are converted to 8 bit indexed color PNG format with the colors reduced. You can also request 24 bit PNG or JPEG images. However, note that only 8 bit PNGs are guaranteed to work on all MIDP 2.0 mobile Java implementations.

Note. The old picviewer service has been removed and its functionality has been separated into Image service and Syndication service. Now the sole purpose of Image service is to fetch images on demand. Syndication service takes care of delivering feed content such as Flickr image feeds.

The service consists of four actions of which only the first is necessary in normal development:

Action Generic Function
geturl yes Receive an image scaled to the size specified in the call. The caller can set a bounding box into which the image is fitted. Other optional arguments are also possible.
getres yes Gets a widget image resource with the id.
getwidgeticon yes Gets a widget icon using the widget id.
getavatar yes Gets an user avatar using the user name.


Scaling

Images are scaled using a bounding box. The image is resized so that it fits completely into the dimensions of the box. The original aspect ratio of the image is conserved. Maximum dimensions for the box are 1920x1920 pixels. Also, source images larger than this are scaled down to fit into the maximum box if neither bounding box arguments are given.

Service actions

The following sections describe the specifications for the available service actions.

Action geturl

namespace geturl is ContentAction
{
  input = (list (bag (bind (const url) (string url))
                     (optional (bind (const boundx) (int boundx)))
                     (optional (bind (const boundy) (int boundy)))
                     (optional (bind (const minsize) (int bytesize)))
                     (optional (bind (const minwidth) (int minwidth)))
                     (optional (bind (const minheight) (int minheight)))
                     (optional (bind (const refreshtime) (int seconds)))
                     (optional (bind (const format) 
                                     (choice (const png8)
                                             (const png24)
                                             (const jpeg))))))
    
    
  output = (bytes imageData)
    
  generic = true
}
Arguments

The only required argument is url. The rest are optional.

name type Description
url string The URL of the image.
boundx int The width of the bounding box.
boundy int The height of the bounding box.
minsize int The minimum size of the image in bytes of the source image.
minwidth int The minimum width of the image in pixels of the source image.
minheight int The minimum height of the image in pixels of the source image.
refreshtime int Caching time of the image in seconds. If this argument is not given the default will be 10800s. The minimum is 60s.
format png8 | png24 | jpeg The desired encode format. Please use png-images for maximum compatibility.
Errors
Code Message Description
error Unable to get image: <message> Something went wrong. For example, the server returned 404 for the requested URL.


Action getres

namespace getres is ContentAction
{
  input = (list (bag (bind (const id) (int resourceId))
                     (optional (bind (const boundx) (int boundx)))
                     (optional (bind (const boundy) (int boundy)))
                     (optional (bind (const format) 
                                     (choice (const png8)
                                             (const png24)
                                             (const jpeg))))))
  

  output = (bytes resourceData)  
  
  generic = true
}
Errors
Code Message Description
notfound Image not found or access denied. No such resource id, or user trying to get resource of a PRIVATE widget belonging to another user.
notimage The requested resource was not an image. The requested resource was of some other type.
error Unable to get image: <message> Something went wrong. For example, a temporary error.


Action getwidgeticon

namespace getwidgeticon is ContentAction
{
  input = (int widgetId)
    
  output = (bytes iconResourceData)

  generic = true
}
Errors
Code Message Description
notfound Image not found or access denied. No such icon
error Unable to get image: <message> Something went wrong, for example, a temporary error.


Action getavatar

namespace getavatar is ContentAction
{
  input = (list (bag (bind (const username) (string username))
                     (optional (bind (const boundx) (int boundx)))
                     (optional (bind (const boundy) (int boundy)))
                     (optional (bind (const format) 
                                     (choice (const png8)
                                             (const png24)
                                             (const jpeg))))))
                                              
  output = (bytes avatarImageData)

  generic = true
    
}
Errors
Code Message Description
notfound Image not found or access denied. No such avatar.
error Unable to get image: <message>. Something went wrong. For example, a temporary error.

Code example

Example Image Service

See also

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fWidSetsE5fforE5fAdvanceE5fE45PE5f1E5fE3aE5fE4cifeE5fPicturesE5fProjectX qdcZpublisherQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fidE2fc764fd1cE2d8b06E2d499aE2d9a6aE2d17c3903d5a65E2fforumE5fnokiaE5fcrawlerE5fagentX qdcZtitleQSxWidSetsE20forE20AdvanceE20E45PE201E20E3aE20E4cifeE20PicturesE20ProjectE20E2dE20ForumE20NokiaE20WikiX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qrssZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qfnZdistributionQUxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2fX qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZupdatedQDx2008E2d10E2d03X qmarsZdescriptionQSxEa0E20WikiE20javaE20symbianE5fosE20s60E20maemoE20cE2bE2bE20WikiE20HomeE20WikiE20HelpE20OverviewE20GlossaryE20CreateE20PageE20ProposeE20anE20ArticleE20SpotlightE20TopicE20E2dE20WE52TE20WidgetsE20ProgrammingE20E4canguageE20E2dE20SymbianE20CE2bE2bE20E2dE20OpenE20CE2fCE2bE2bE20E2dE20JavaE20E2dE20FlashE20E4citeE20E2dE20PythonE20WebE20TechnologiesE20E2dE20WE52TE20WidgetsE20E2dE20WidSetsE20ToolsE20andE20SE44KE20CodeE20E45E78amplesE20KnowledgeE20BaseE20TechnologyE20AreasE20SoftwareE20PlatformsE20E44evelopmentE20ProcessE20E3fE3fWikiE20ChineseE20E3fE3fE3fWikiE20JapaneseE20PortugueseE2fBrazilianE20E52ussianE20WhatE20linksE20hereE20UploadE20fileE20SpecialE20pagesE20PrintableE20versionE44ownloadE20asE20PE44FE20GoE20ToE20E2eE2eE2eX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ