1 /*
2  * swiggle - le's simple web image gallery generator
3  *
4  * Copyright (c) 2003, 2004, 2006
5  *  Lukas Ertl <l.ertl@univie.ac.at>.  All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. All advertising materials mentioning features or use of this software
16  *    must display the following acknowledgement:
17  *  This product includes software developed by the University of
18  *  California, Berkeley and its contributors.
19  * 4. Neither the name of the University nor the names of its contributors
20  *    may be used to endorse or promote products derived from this software
21  *    without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  *
35  *
36  * $Id: swiggle.h,v 1.8 2006/11/12 21:41:46 le Exp $
37  *
38  */
39 
40 #ifndef	SWIGGLE_H
41 #define	SWIGGLE_H
42 
43 #include <sys/types.h>
44 
45 #include <jpeglib.h>
46 #include <libexif/exif-data.h>
47 
48 #define	SWIGGLE_VERSION	"0.4"
49 #define	SIZE_UCHAR	sizeof(unsigned char)
50 
51 struct imginfo {
52 	char	*filename;
53 	char	*description;
54 	int	filesize;
55 	time_t	mtime;
56 	int	width;
57 	int	height;
58 	int	scalewidth;
59 	int	scaleheight;
60 	int	thumbwidth;
61 	int	thumbheight;
62 	char	*model;
63 	char	*datetime;
64 	char	*exposuretime;
65 	char	*flash;
66 	char	*aperture;
67 };
68 
69 struct imgdesc {
70 	char	*filename;
71 	char	*desc;
72 };
73 
74 void	create_html(char *, struct imginfo *, int);
75 int	create_thumbindex(char *, struct imginfo *, int, int);
76 
77 int resize_bicubic(struct jpeg_decompress_struct *,
78     struct jpeg_compress_struct *, const unsigned char *, unsigned char **);
79 int resize_bilinear(struct jpeg_decompress_struct *,
80     struct jpeg_compress_struct *, const unsigned char *, unsigned char **);
81 #endif	/* SWIGGLE_H */
82