Leptonica 1.68
C Image Processing Library

viewfiles.c File Reference

Generates html for viewing a directory of images. More...

#include <string.h>
#include "allheaders.h"

Go to the source code of this file.

Defines

#define L_BUF_SIZE   512

Functions

l_int32 pixHtmlViewer (const char *dirin, const char *dirout, const char *rootname, l_int32 thumbwidth, l_int32 viewwidth, l_int32 copyorig)

Variables

static const l_int32 DEFAULT_THUMB_WIDTH = 120
static const l_int32 DEFAULT_VIEW_WIDTH = 800
static const l_int32 MIN_THUMB_WIDTH = 50
static const l_int32 MIN_VIEW_WIDTH = 300

Detailed Description

Generates html for viewing a directory of images.

   Generate smaller images for viewing and write html
      l_int32    pixHtmlViewer()

Definition in file viewfiles.c.


Define Documentation

#define L_BUF_SIZE   512

Definition at line 27 of file viewfiles.c.

Referenced by pixHtmlViewer().


Function Documentation

l_int32 pixHtmlViewer ( const char *  dirin,
const char *  dirout,
const char *  rootname,
l_int32  thumbwidth,
l_int32  viewwidth,
l_int32  copyorig 
)

pixHtmlViewer()

Input: dirin: directory of input image files dirout: directory for output files rootname: root name for output files thumbwidth: width of thumb images (in pixels; use 0 for default) viewwidth: maximum width of view images (no up-scaling) (in pixels; use 0 for default) copyorig: 1 to copy originals to dirout; 0 otherwise Return: 0 if OK; 1 on error

Notes: (1) The thumb and view reduced images are generated, along with two html files: <rootname>.html and <rootname>-links.html (2) The thumb and view files are named <rootname>_thumb_xxx.jpg <rootname>_view_xxx.jpg With this naming scheme, any number of input directories of images can be processed into views and thumbs and placed in the same output directory.

Definition at line 63 of file viewfiles.c.

References DEFAULT_THUMB_WIDTH, DEFAULT_VIEW_WIDTH, ERROR_INT, FREE, genPathname(), getFilenamesInDirectory(), IFF_JFIF_JPEG, l_binaryWrite(), L_BUF_SIZE, L_COPY, L_NOCOPY, L_WARNING, MIN_THUMB_WIDTH, MIN_VIEW_WIDTH, nfiles, NULL, pixClone(), pixDestroy(), pixGetWidth(), pixRead(), pixScale(), pixWrite(), PROCNAME, sarrayAddString(), sarrayCreate(), sarrayDestroy(), sarrayGetCount(), sarrayGetString(), sarrayToString(), stringJoin(), and stringNew().

Referenced by main().


Variable Documentation

const l_int32 DEFAULT_THUMB_WIDTH = 120 [static]

Definition at line 29 of file viewfiles.c.

Referenced by pixHtmlViewer().

const l_int32 DEFAULT_VIEW_WIDTH = 800 [static]

Definition at line 30 of file viewfiles.c.

Referenced by pixHtmlViewer().

const l_int32 MIN_THUMB_WIDTH = 50 [static]

Definition at line 31 of file viewfiles.c.

Referenced by pixHtmlViewer().

const l_int32 MIN_VIEW_WIDTH = 300 [static]

Definition at line 32 of file viewfiles.c.

Referenced by pixHtmlViewer().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines