angerangel edited this page Jan 3, 2013 · 1 revision

Table of Contents

USAGE

  DECODE type data

DESCRIPTION

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

ARGUMENTS

  • type -- Media type (jpeg, png, etc.) (word!)
  • data -- The data to decode (binary!)

SOURCE

decode: make function! [  [
    {Decodes a series of bytes into the related datatype (e.g. image!).}
    type [word!] "Media type (jpeg, png, etc.)"
    data [binary!] "The data to decode"
    /local cod
][
    unless all [
        cod: select system/codecs type
        data: do-codec cod/entry 'decode data
    ] [
        cause-error 'access 'no-codec type
    ]
    data
] ] 
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.