From d2e91935a5d0d09403eece115382024fa5edc861 Mon Sep 17 00:00:00 2001 From: "Leigh B. Stoller" Date: Fri, 4 Jul 2003 14:24:16 +0000 Subject: [PATCH] Direct the thumb render to the expwork directory, and then copy to www/thumb directory. Putting it in the expwork directory causes the .png file to saved in the users exp directory, and in the longterm archive for the experiment (expinfo). If we decide to keep NS files in the DB for longterm storage, we should keep the .png files along with them (they are generally very small, under 1k bytes). --- vis/prerender.in | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/vis/prerender.in b/vis/prerender.in index 810e50125..52d7597d5 100644 --- a/vis/prerender.in +++ b/vis/prerender.in @@ -2,7 +2,7 @@ # # EMULAB-COPYRIGHT -# Copyright (c) 2000-2002 University of Utah and the Flux Group. +# Copyright (c) 2000-2003 University of Utah and the Flux Group. # All rights reserved. # @@ -429,12 +429,17 @@ foreach $node (keys %nodes) { } } -### Generate thumbnail, if called for. +# Generate thumbnail, if called for. The .png file is put into the work +# directory, so it is copied off to the users and the archive directory. if ($thumb) { - if (system("$THUMB_CMD $pid $eid > @prefix@/www/thumbs/tn$thumb.png")) { + my $workdir = TBExptWorkDir($pid, $eid); + my $fname = "$workdir/$eid.png"; + + if (system("$THUMB_CMD $pid $eid > $fname")) { print STDERR "Error generating thumbnail.\n"; } + system("cp -pf $fname @prefix@/www/thumbs/tn$thumb.png"); } ### Success!! -- GitLab