24 June 2020
26 November 2016
6 October 2016
22 September 2016
10 July 2016
23 May 2015
4 May 2014
formatparameter for the
Textureasset-type that will allow downloading to a different format other than JPEG2000.
14 December 2014
|Type||Corrade progressive command|
|Last Changes||Release 9.133 - The command now can take a path instead of a name.|
download command can be used to download assets from the grid.
|Command||Required Parameters||Required Corrade Permissions||Example|
| || || ||
llInstantMessage(CORRADE, wasKeyValueEncode( [ // Download a texture by UUID "command", "download", "group", wasURLEscape(GROUP), "password", wasURLEscape(PASSWORD), // or the path to an item in Corrade's inventory "item", "742c887b-a8ed-ba7b-6e7f-8ba8e9d1d76a", "type", "Texture", "callback", wasURLEscape(URL) ] ) );
|Parameter||Possible Value||Optional Parameter||Possible Value||Description||Download from|
| || || ||One of the supported formats.|| Downloads a texture in the specified format or in JPEG2000 format in case ||Asset server|
| || ||One of the supported formats.||Downloads a sound in OGG Vorbis format by default or in one of the supported formats.||Asset server|
| ||Downloads an animation in .animatn format.||Asset server|
| ||Downloads wearables.||Asset server|
| ||Downloads body parts.||Asset server|
| ||Downloads landmarks.||Asset server|
| ||Downloads gestures.||Asset server|
| ||Downloads notecards.||Inventory|
| ||Downloads scripts.||Inventory|
and the data retrieved is compatible with the data supplied to the
|Optional Parameter||Possible Value||Description|
| || A path-name ending in a file name (e.g.: ||If a path is specified, then the asset will be saved to the file name indicated by the path.|
In case the
path optional parameter is not specified, then the asset will be downloaded, encoded as a Base64 string, then URI escaped and then placed as the value to the
data key from the callback. If the
path parameter is specified, then the data will be saved to the indicated path.
Grid clients such as Corrade download and upload textures to the grid in the JPEG2000 image format. The upload of textures in different formats other than JPEG2000 is provided as a convenience but Linden grids can only accept JPEG2000 images. In other words, regardless of the image format that you want to upload, Corrade will have to convert the image to the JPEG2000 format (with lossless compression) and only then upload it. You may want to rethink your application in case you really depend on some format provided here and convert your images to JPEG2000 yourself before uploading. For instance, under Windows, uploading a 24-bit PNG is meaningless from Corrade's perspective because the grid does not accept such a format (only JPEG2000) such that the 24-bit PNG will be first converted to JPEG2000 and then uploaded.
A counter-example when using any other format other than JPEG2000 is useful when you need to upload or download an image from PHP (or other environments) that do not have built-in support for the JPEG2000 image format. In such cases, in order to not over-complicate your script, you can use the formats listed here depending on your platform. However, as mentioned previously, be weary because grid clients can only upload textures in the JPEG2000 format such that you could probably convert your image to JPEG2000 better than having Corrade do it for you.
The supported image formats are the following:
|Format Parameter Value||Description|
| ||Windows Bitmap|
| ||Graphics Interchange Format|
| ||JPEG File Exchange Format - this is not JPEG2000|
| ||Portable Network Graphics|
| ||Tagged Image File Format|
format parameter will result in a JPEG2000 image to be downloaded directly off the asset server. The JPEG2000 image format is defined with various profiles, such that if the downloaded image is saved to a file and then inspected by the
exiftool command line utilities, the detected image description will be:
which indicates a Profile 0 JPEG2000 which is what the SecondLife grid seems to be using. Profile 0 (subset of 1, 2) was probably chosen to maximize compatibility with tools that have not yet implemented full support for JPEG2000.
The proper file extension for such images is "j2c" which stands for JPEG2000 codestream. Some tools may not properly implement nor respect the file extension. For instance, using
ffmpeg to convert an image to JPEG2000 codestream:
ffmpeg -i img.png img.j2c
will result in a Profile 1 JPEG2000 instead of a JPEG2000 Profile 0 codestream such that it is imperative to make sure that the proper tools are used when downloading or uploading images.
Furthermore, Corrade follows the SecondLife limits on texture uploads without any processing such that the user must ensure that the texture to be uploaded conforms to the specification.
By default sounds are stored on the grid in OGG-Vorbis format and Corrade can download the sound file as OGG.
all the other assets can be grabbed by Corrade's
download command in case the UUID of the item is known.
Textures, sounds and animations are well-known formats that, once received, can be easily reused and converted to something else. On the other hand, clothing, landmarks, gestures, notecards and scripts (
LSLText) are Linden-based formats that cannot be converted directly.
Some of these formats, for example
Clothing, include references to images which will have to be pulled separately by first retrieving the clothing, going through the file and gathering UUIDs and then issuing another download to fetch the textures.