Skip to content
Snippets Groups Projects
Select Git revision
  • f6da7b6291706ae2be3041d24f35eba4038c9236
  • master default protected
  • 9.0
  • marcus/wix3
  • 8.0
  • nt-tools
  • 7.8
  • 7.6
  • 7.4
  • 7.2
  • 7.0
  • 0.6
  • rosuav/latex-markdown-renderer
  • rxnpatch/rxnpatch
  • marcus/gobject-introspection
  • rxnpatch/8.0
  • rosuav/pre-listening-ports
  • rosuav/async-annotations
  • rosuav/pgsql-ssl
  • rxnpatch/rxnpatch-broken/2023-10-06T094250
  • grubba/fdlib
  • v8.0.2020
  • v8.0.2018
  • v8.0.2016
  • v8.0.2014
  • v8.0.2012
  • v8.0.2008
  • v8.0.2006
  • v8.0.2004
  • v8.0.2002
  • v8.0.2000
  • v8.0.1998
  • v8.0.1996
  • v8.0.1994
  • v8.0.1992
  • v8.0.1990
  • v8.0.1988
  • v8.0.1986
  • rxnpatch/clusters/8.0/2025-04-29T124414
  • rxnpatch/2025-04-29T124414
  • v8.0.1984
41 results

module_support.c

Blame
  • any.c 3.82 KiB
    /* $Id: any.c,v 1.10 1999/05/28 13:30:51 mirar Exp $ */
    
    /*
    **! module Image
    **! note
    **!	$Id: any.c,v 1.10 1999/05/28 13:30:51 mirar Exp $
    **! submodule ANY
    **!
    **!	This method calls the other decoding methods
    **!	and has some heuristics for what type of image
    **!	this is.
    **!
    **!	Methods:
    **!	<ref>decode</ref>, <ref>decode_alpha</ref>,
    **!	<ref>_decode</ref>
    **!
    **! see also: Image
    **!
    */
    #include "global.h"
    
    #include <math.h>
    #include <ctype.h>
    
    #include "stralloc.h"
    RCSID("$Id: any.c,v 1.10 1999/05/28 13:30:51 mirar Exp $");
    #include "pike_macros.h"
    #include "operators.h"
    #include "builtin_functions.h"
    #include "object.h"
    #include "constants.h"
    #include "interpret.h"
    #include "svalue.h"
    #include "threads.h"
    #include "array.h"
    #include "error.h"
    #include "threads.h"
    
    #include "image.h"
    
    void image_gif__decode(INT32 args);
    void image_pnm_decode(INT32 args);
    void image_xwd__decode(INT32 args);
    
    /*
    **! method mapping _decode(string data)
    **! method object decode(string data)
    **! method object decode_alpha(string data)
    **!	Tries heuristics to find the correct method 
    **!	of decoding the data, then calls that method.
    **!
    **! 	The result of _decode() is a mapping that contains
    **!	<pre>
    **!		"type":image data type (ie, "image/jpeg" or similar)
    **!		"image":the image object,
    **!		"alpha":the alpha channel or 0 if N/A
    **!	</pre>
    **!
    **! note
    **!	Throws upon failure.
    */
    
    void image_any__decode(INT32 args)
    {
       if (args!=1 || sp[-args].type!=T_STRING)
          error("Image.ANY.decode: illegal arguments\n");
       
       if (sp[-args].u.string->len<4)
          error("Image.ANY.decode: too short string\n");