--- html.c.orig Sat Oct 23 22:57:02 2004 +++ html.c Wed Nov 1 15:45:01 2006 @@ -50,6 +50,7 @@ #define MAX_PER_PAGE (cols*rows) extern int cols; +extern int exif_display; extern int rows; extern char generated[]; extern char *albumdesc; @@ -115,37 +116,66 @@ imglist[x].width, imglist[x].height, (int) (imglist[x].filesize/1024)); - - fprintf(html, "\n"); - - if (imglist[x].datetime != NULL) { - fprintf(html, "\n" - "\n\n", - imglist[x].datetime); - } - if (imglist[x].aperture != NULL) { - fprintf(html, "\n" - "\n\n", - imglist[x].aperture); - } - if (imglist[x].exposuretime != NULL) { - fprintf(html, "\n\n\n", - imglist[x].exposuretime); - } - if (imglist[x].flash != NULL) { - fprintf(html, "\n" - "\n\n", - imglist[x].flash); - } - if (imglist[x].model != NULL) { - fprintf(html, "\n" - "\n\n", - imglist[x].model); + + /* Display by default */ + if (exif_display == 1) { + fprintf(html, "
Taken:%s
Aperture:%s
Exposure Time:" - "%s
Flash:%s
Model:%s
\n"); + + if (imglist[x].datetime != NULL) { + fprintf(html, "\n" + "\n\n", + imglist[x].datetime); + } + if (imglist[x].aperture != NULL) { + fprintf(html, "\n" + "\n\n", + imglist[x].aperture); + } + if (imglist[x].exposuretime != NULL) { + fprintf(html, "\n\n\n", + imglist[x].exposuretime); + } + if (imglist[x].flash != NULL) { + fprintf(html, "\n" + "\n\n", + imglist[x].flash); + } + if (imglist[x].model != NULL) { + fprintf(html, "\n" + "\n\n", + imglist[x].model); + } + + fprintf(html, "
Taken:%s
Aperture:%s
Exposure Time:" + "%s
Flash:%s
Model:%s
\n

\n\n"); + /* Hide in comments if user requests */ + } else if (exif_display == 2) { + fprintf(html, "\n"); } - fprintf(html, "\n

\n\n"); - if (offset == 1) { fprintf(html, "" "Back to thumbnails\n"); @@ -197,7 +227,7 @@ * Returns the number of thumbnail index pages created. */ int -create_thumbindex(char *dir, struct imginfo *imglist, int imgcount) +create_thumbindex(char *dir, struct imginfo *imglist, int imgcount, int show_descr) { char *desc, final[MAXPATHLEN], tmp[MAXPATHLEN]; int pages, offset, x, y; @@ -277,21 +307,33 @@ while (x < y) { if (x % cols == 0) fprintf(html, "\n"); - - fprintf(html, "\n" - "\"%s\"
\n%d x %d, %d KB" - "\n

\n\n", - imglist[x].filename, - imglist[x].filename, - imglist[x].filename, - imglist[x].thumbwidth, - imglist[x].thumbheight, - imglist[x].width, - imglist[x].height, - (int)(imglist[x].filesize / 1024)); - + if (show_descr) { + fprintf(html, "\n" + "\"%s\"
\n%s" + "\n

\n\n", + imglist[x].filename, + imglist[x].filename, + imglist[x].filename, + imglist[x].thumbwidth, + imglist[x].thumbheight, + imglist[x].description); + } else { + fprintf(html, "\n" + "\"%s\"
\n%d x %d, %d KB" + "\n

\n\n", + imglist[x].filename, + imglist[x].filename, + imglist[x].filename, + imglist[x].thumbwidth, + imglist[x].thumbheight, + imglist[x].width, + imglist[x].height, + (int)(imglist[x].filesize / 1024)); + } if ((x % cols == cols - 1) || (x + 1 == imgcount)) fprintf(html, "\n");