Skip to content
Snippets Groups Projects
Commit ab0c3fdc authored by Mirar (Pontus Hagland)'s avatar Mirar (Pontus Hagland)
Browse files

added: decode_header

Rev: src/modules/_Image_XFace/image_xface.c:1.5
parent 5645b63a
No related branches found
No related tags found
No related merge requests found
#include "global.h" #include "global.h"
RCSID("$Id: image_xface.c,v 1.4 1998/04/09 00:44:08 marcus Exp $"); RCSID("$Id: image_xface.c,v 1.5 1998/06/19 15:12:45 mirar Exp $");
#include "config.h" #include "config.h"
...@@ -432,6 +432,48 @@ static void image_xface_encode(INT32 args) ...@@ -432,6 +432,48 @@ static void image_xface_encode(INT32 args)
} }
} }
/*
**! method object decode_header(string data)
**! method object decode_header(string data, mapping options)
**! Decodes an X-Face image header.
**!
**! <pre>
**! "xsize":int
**! "ysize":int
**! size of image
**! "type":"image/x-xface"
**! file type information
**! </pre>
**!
**! The <tt>options</tt> argument may be a mapping
**! containing zero options.
**!
**! note
**! There aint no such thing as a X-Face image header.
**! This stuff tells the characteristics of an X-Face image.
**!
*/
static void image_xface_decode_header(INT32 args)
{
if(args<1 || sp[-args].type!=T_STRING)
error("Image.XFace.decode: Illegal arguments\n");
pop_n_elems(args);
push_text("type");
push_text("image/x-xface");
push_text("xsize");
push_int(48);
push_text("ysize");
push_int(48);
f_aggregate_mapping(6);
}
#endif /* HAVE_GMP_H */ #endif /* HAVE_GMP_H */
/*** module init & exit & stuff *****************************************/ /*** module init & exit & stuff *****************************************/
...@@ -460,6 +502,8 @@ void pike_module_init(void) ...@@ -460,6 +502,8 @@ void pike_module_init(void)
{ {
add_function("decode",image_xface_decode, add_function("decode",image_xface_decode,
"function(string,void|mapping(string:int):object)",0); "function(string,void|mapping(string:int):object)",0);
add_function("decode_header",image_xface_decode_header,
"function(string,void|mapping(string:int):object)",0);
add_function("encode",image_xface_encode, add_function("encode",image_xface_encode,
"function(object,void|mapping(string:int):string)",0); "function(object,void|mapping(string:int):string)",0);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment