Added redirect flag and updated 'git-describe' command reference.

This commit is contained in:
Stuart Longland 2008-10-18 12:38:35 +10:00
parent dcada45e31
commit 7dd8ccd135
2 changed files with 11 additions and 1 deletions

View File

@ -12,7 +12,7 @@ OBJS=obj/main.o obj/util.o obj/galleries.o obj/gallery.o obj/varray.o \
$(CS_PATH)/lib/libneo_cgi.a $(CS_PATH)/lib/libneo_cs.a \
$(CS_PATH)/lib/libneo_utl.a
VERSIONSTAMP=$(shell if [ -d .git ]; then git-describe; else cat version; fi)
VERSIONSTAMP=$(shell if [ -d .git ]; then git describe; else cat version; fi)
COMPILESTAMP=$(shell date "+%Y-%m-%d %H:%M:%S %z" )
gallery.cgi: $(OBJS)

View File

@ -418,6 +418,16 @@ void photo_handler( struct gallery_info* gallery,
/* Shut down ImageMagick */
MagickWandTerminus();
/*
* Were we just asked for an image?
* If so, just point them to the file and leave it at that.
*/
if ( hdf_get_int_value( cgi->hdf, "Query.redirect", 0 ) ) {
/* We will do this ignoring the ClearSilver library */
printf("Location: %s/%s\n\n", get_cgiuri(), resized);
return;
}
/* Populate HDF structure */
hdf_set_value( cgi->hdf, "gallery.name", gallery->gallery_name );