diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2006-11-01 17:53:24 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2006-11-01 17:53:24 +0000 |
commit | 91c8384bd31da285d340d1f211b56eeaed706f15 (patch) | |
tree | 34f93dee662b97dde0f529c78d148f9b1db95e08 /www/swiggle | |
parent | f42ccf6dd12ff7ea2ce28b557d4e7a7a5c4e4e00 (diff) | |
download | ports-91c8384bd31da285d340d1f211b56eeaed706f15.tar.gz ports-91c8384bd31da285d340d1f211b56eeaed706f15.zip |
Notes
Diffstat (limited to 'www/swiggle')
-rw-r--r-- | www/swiggle/Makefile | 2 | ||||
-rw-r--r-- | www/swiggle/files/patch-html.c | 164 | ||||
-rw-r--r-- | www/swiggle/files/patch-swiggle.c | 70 | ||||
-rw-r--r-- | www/swiggle/files/patch-swiggle.h | 11 |
4 files changed, 246 insertions, 1 deletions
diff --git a/www/swiggle/Makefile b/www/swiggle/Makefile index 9d9718aab08f..38d41c8670c2 100644 --- a/www/swiggle/Makefile +++ b/www/swiggle/Makefile @@ -6,7 +6,7 @@ PORTNAME= swiggle PORTVERSION= 0.3.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www MASTER_SITES= http://homepage.univie.ac.at/l.ertl/swiggle/files/ \ http://bsd-geek.de/FreeBSD/distfiles/ diff --git a/www/swiggle/files/patch-html.c b/www/swiggle/files/patch-html.c new file mode 100644 index 000000000000..2a0a8bfbdc26 --- /dev/null +++ b/www/swiggle/files/patch-html.c @@ -0,0 +1,164 @@ +--- 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, "<table width=\"100%%\" border=\"1\">\n"); +- +- if (imglist[x].datetime != NULL) { +- fprintf(html, "<tr>\n<td><small>Taken:</small></td>" +- "<td><small>%s</small></td>\n</tr>\n", +- imglist[x].datetime); +- } +- if (imglist[x].aperture != NULL) { +- fprintf(html, "<tr>\n<td><small>Aperture:</small></td>" +- "<td><small>%s</small></td>\n</tr>\n", +- imglist[x].aperture); +- } +- if (imglist[x].exposuretime != NULL) { +- fprintf(html, "<tr>\n<td><small>Exposure Time</small>:" +- "</td><td><small>%s</small></td>\n</tr>\n", +- imglist[x].exposuretime); +- } +- if (imglist[x].flash != NULL) { +- fprintf(html, "<tr>\n<td><small>Flash:</small></td>" +- "<td><small>%s</small></td>\n</tr>\n", +- imglist[x].flash); +- } +- if (imglist[x].model != NULL) { +- fprintf(html, "<tr>\n<td><small>Model:</small></td>" +- "<td><small>%s</small></td>\n</tr>\n", +- imglist[x].model); ++ ++ /* Display by default */ ++ if (exif_display == 1) { ++ fprintf(html, "<table width=\"100%%\" border=\"1\">\n"); ++ ++ if (imglist[x].datetime != NULL) { ++ fprintf(html, "<tr>\n<td><small>Taken:</small></td>" ++ "<td><small>%s</small></td>\n</tr>\n", ++ imglist[x].datetime); ++ } ++ if (imglist[x].aperture != NULL) { ++ fprintf(html, "<tr>\n<td><small>Aperture:</small></td>" ++ "<td><small>%s</small></td>\n</tr>\n", ++ imglist[x].aperture); ++ } ++ if (imglist[x].exposuretime != NULL) { ++ fprintf(html, "<tr>\n<td><small>Exposure Time:</small>" ++ "</td><td><small>%s</small></td>\n</tr>\n", ++ imglist[x].exposuretime); ++ } ++ if (imglist[x].flash != NULL) { ++ fprintf(html, "<tr>\n<td><small>Flash:</small></td>" ++ "<td><small>%s</small></td>\n</tr>\n", ++ imglist[x].flash); ++ } ++ if (imglist[x].model != NULL) { ++ fprintf(html, "<tr>\n<td><small>Model:</small></td>" ++ "<td><small>%s</small></td>\n</tr>\n", ++ imglist[x].model); ++ } ++ ++ fprintf(html, "</table>\n<p>\n<small>\n"); ++ /* Hide in comments if user requests */ ++ } else if (exif_display == 2) { ++ fprintf(html, "<!-- Begin EXIF data\n"); ++ ++ if (imglist[x].datetime != NULL) { ++ fprintf(html, "Taken: %s\n", ++ imglist[x].datetime); ++ } ++ if (imglist[x].aperture != NULL) { ++ fprintf(html, "Aperture: %s\n", ++ imglist[x].aperture); ++ } ++ if (imglist[x].exposuretime != NULL) { ++ fprintf(html, "Exposure Time: %s\n", ++ imglist[x].exposuretime); ++ } ++ if (imglist[x].flash != NULL) { ++ fprintf(html, "Flash: %s\n", ++ imglist[x].flash); ++ } ++ if (imglist[x].model != NULL) { ++ fprintf(html, "Model: %s\n", ++ imglist[x].model); ++ } ++ ++ fprintf(html, "End EXIF data -->\n"); + } + +- fprintf(html, "</table>\n<p>\n<small>\n"); +- + if (offset == 1) { + fprintf(html, "<a href=\"index.html\">" + "Back to thumbnails</a>\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, "<tr>\n"); +- +- fprintf(html, "<td align=\"center\">\n" +- "<a href=\"%s.html\"><img src=\".thumbs/%s\" " +- "border=\"0\" alt=\"%s\" width=\"%d\" " +- "height=\"%d\"></a><br>\n<small>%d x %d, %d KB" +- "</small>\n<br><br>\n</td>\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, "<td align=\"center\">\n" ++ "<a href=\"%s.html\"><img src=\".thumbs/%s\" " ++ "border=\"0\" alt=\"%s\" width=\"%d\" " ++ "height=\"%d\"></a><br>\n<small>%s" ++ "</small>\n<br><br>\n</td>\n", ++ imglist[x].filename, ++ imglist[x].filename, ++ imglist[x].filename, ++ imglist[x].thumbwidth, ++ imglist[x].thumbheight, ++ imglist[x].description); ++ } else { ++ fprintf(html, "<td align=\"center\">\n" ++ "<a href=\"%s.html\"><img src=\".thumbs/%s\" " ++ "border=\"0\" alt=\"%s\" width=\"%d\" " ++ "height=\"%d\"></a><br>\n<small>%d x %d, %d KB" ++ "</small>\n<br><br>\n</td>\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, "</tr>\n"); + diff --git a/www/swiggle/files/patch-swiggle.c b/www/swiggle/files/patch-swiggle.c new file mode 100644 index 000000000000..96b6bfc52380 --- /dev/null +++ b/www/swiggle/files/patch-swiggle.c @@ -0,0 +1,70 @@ +--- swiggle.c.orig Sat Oct 23 22:58:37 2004 ++++ swiggle.c Wed Nov 1 16:34:10 2006 +@@ -66,12 +66,14 @@ + char generated[1024]; + char *progname = ""; + int cols = 5; ++int exif_display = 1; /* By default, display the exif data */ + int rows = 3; + int scaleheight = 480; + int thumbheight = 96; + int force = 0; + int bilinear = 0; + int rm_orphans = 1; ++int show_descr = 0; + int (*sort_func)(); + + #define MAX_PER_PAGE (cols*rows) +@@ -113,7 +115,7 @@ + progname = argv[0]; + sort_func = sort_by_filename; + +- while ((i = getopt(argc, argv, "c:d:h:H:r:s:flov")) != -1) { ++ while ((i = getopt(argc, argv, "c:d:h:H:r:s:DeEflov")) != -1) { + switch (i) { + case 'c': + cols = (int) strtol(optarg, &eptr, 10); +@@ -163,6 +165,12 @@ + usage(); + } + break; ++ case 'e': ++ exif_display = 2; ++ break; ++ case 'E': ++ exif_display = 0; ++ break; + case 'f': + force = 1; + break; +@@ -172,6 +180,9 @@ + case 'o': + rm_orphans = 0; + break; ++ case 'D': ++ show_descr = 1; ++ break; + case 'v': + version(); + break; +@@ -353,7 +364,7 @@ + qsort(imglist, imgcount, sizeof(struct imginfo), sort_func); + + create_html(dir, imglist, imgcount); +- x = create_thumbindex(dir, imglist, imgcount); ++ x = create_thumbindex(dir, imglist, imgcount, show_descr); + printf("%d thumbnail index pages created.\n", x); + } + +@@ -1040,6 +1051,11 @@ + "(default: %d)\n", thumbheight); + fprintf(stderr, " -H <j> ... height of the scaled images in pixel " + "(default: %d)\n", scaleheight); ++ fprintf(stderr, " -e ... don't display exif data on the page, " ++ "insert it in html comments\n"); ++ fprintf(stderr, " -E ... don't display exif data at all\n"); ++ fprintf(stderr, " -D ... display filename instead of size on " ++ "index page\n"); + fprintf(stderr, " -f ... force rebuild of everything; ignore " + "cache\n"); + fprintf(stderr, " -o ... don't remove orphaned files\n"); diff --git a/www/swiggle/files/patch-swiggle.h b/www/swiggle/files/patch-swiggle.h new file mode 100644 index 000000000000..b1a72c2e85ef --- /dev/null +++ b/www/swiggle/files/patch-swiggle.h @@ -0,0 +1,11 @@ +--- swiggle.h.orig Sat Oct 23 22:58:37 2004 ++++ swiggle.h Wed Nov 1 15:43:27 2006 +@@ -72,7 +72,7 @@ + }; + + void create_html(char *, struct imginfo *, int); +-int create_thumbindex(char *, struct imginfo *, int); ++int create_thumbindex(char *, struct imginfo *, int, int); + + int resize_bicubic(struct jpeg_decompress_struct *, + struct jpeg_compress_struct *, const unsigned char *, unsigned char **); |