REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 21-Aug-2010 Edit History  

REBOL 3 Functions: decode

decode  type  data

Decodes a series of bytes into the related datatype (e.g. image!).

Arguments:

type [word!] - Media type (jpeg, png, etc.)

data [binary!] - The data to decode

See also:

encode   load   enbase   debase  

Description

Used to call codecs to decode binary data (bytes) into related datatypes.

Codecs are identified by words that symbolize their types. For example the word png is used to identify the PNG codec.

See the system/codecs for a list of loaded codecs. Codecs can be native (built-in), externally loaded, or even coded in REBOL.

More about Encode and Decode

Examples

The line:

image: load %photo.jpg

is roughly equivalent to:

data: read %photo.jpg  ; returns binary data
image: decode 'jpeg data


  TOC < Back Next > REBOL.com - WIP Wiki Feedback Admin