diff --git a/.gitattributes b/.gitattributes index 2bce27d2944865be8b482400e322641ca24abbbe..2b1b6e0444a723c6c4ce29d05299e4c3969d1995 100644 --- a/.gitattributes +++ b/.gitattributes @@ -80,6 +80,7 @@ testfont binary /src/modules/Image/encodings/gif.c foreign_ident /src/modules/Image/encodings/gif_lzw.c foreign_ident /src/modules/Image/encodings/gif_lzw.h foreign_ident +/src/modules/Image/encodings/png.c foreign_ident /src/modules/Image/encodings/pnm.c foreign_ident /src/modules/Image/font.c foreign_ident /src/modules/Image/illustration.pike foreign_ident diff --git a/src/modules/Image/Makefile b/src/modules/Image/Makefile index 36c8b1d270948045c1053010d90a186a48f970d8..25602485f7ea723ff13b8d301700a1cbb2e8dcca 100644 --- a/src/modules/Image/Makefile +++ b/src/modules/Image/Makefile @@ -2,7 +2,7 @@ DOCFILES = doc-header \ blit.c blit_layer_include.h colortable.c colortable.h dct.c font.c \ image.c image.h matrix.c operator.c pattern.c pnm.c \ - polyfill.c quant.c togif.c x.c encodings/gif.c encodings/gif_lzw.c \ + polyfill.c togif.c x.c encodings/gif.c encodings/gif_lzw.c \ encodings/gif_lzw.h encodings/pnm.c \ doc-footer diff --git a/src/modules/Image/encodings/Makefile.in b/src/modules/Image/encodings/Makefile.in index accd11f8d43dce4088e7d15e1b00910185c26a3f..b703516f04327bfd7467dee0564b61f0826efd0d 100644 --- a/src/modules/Image/encodings/Makefile.in +++ b/src/modules/Image/encodings/Makefile.in @@ -1,6 +1,8 @@ SRCDIR=@srcdir@ VPATH=@srcdir@:@srcdir@/../../..:../../.. -GIF_OBJS = gif.o gif_lzw.o +GIF_OBJS = gif.o gif_lzw.o png.o +JPEG_OBJS = jpeg.o +PNG_OBJS = png.o PNM_OBJS = pnm.o OBJS=gif.a pnm.a @@ -19,6 +21,14 @@ gif.a : $(GIF_OBJS) rm -f gif.a $(AR) cq gif.a $(GIF_OBJS) +png.a : $(PNG_OBJS) + rm -f png.a + $(AR) cq png.a $(PNG_OBJS) + +jpeg.a : $(JPEG_OBJS) + rm -f jpeg.a + $(AR) cq jpeg.a $(JPEG_OBJS) + pnm.a : $(PNM_OBJS) rm -f pnm.a $(AR) cq pnm.a $(PNM_OBJS) diff --git a/src/modules/Image/encodings/png.c b/src/modules/Image/encodings/png.c new file mode 100644 index 0000000000000000000000000000000000000000..21cdafdeb7de15603ee99b99de254d744593379f --- /dev/null +++ b/src/modules/Image/encodings/png.c @@ -0,0 +1,60 @@ +/* $Id: png.c,v 1.1 1997/11/12 03:37:52 mirar Exp $ */ + +/* +**! module Image +**! note +**! $Id: png.c,v 1.1 1997/11/12 03:37:52 mirar Exp $ +**! submodule PNG +**! +**! This submodule keep the PNG encode/decode capabilities +**! of the <ref>Image</ref> module. +**! +**! PNG is a rather new lossless image storage format, +**! usable for most images. +**! +**! Simple encoding: +**! <ref>encode</ref> +**! +**! see also: Image, Image.image, Image.colortable +*/ + +#include <math.h> +#include <ctype.h> + +#include "stralloc.h" +#include "global.h" +RCSID("$Id: png.c,v 1.1 1997/11/12 03:37:52 mirar Exp $"); +#include "pike_macros.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" + +void image_png__module_value(INT32 args) +{ + pop_n_elems(args); + push_text("_Image_dot_PNG"); + SAFE_APPLY_MASTER("resolv",1); + if (sp[-1].type==T_INT) + error("Image.PNG: Can't load submodule\n"); +} + +void init_image_png(void) +{ + start_new_program(); + + add_function("_module_value",image_png__module_value, + "function(:object)",0); + + push_object(clone_object(end_program(),0)); + add_constant(make_shared_string("PNG"),sp-1,0); + pop_stack(); +} + +void exit_image_png(void) +{ +}