[interchange-cvs] interchange - heins modified code/SystemTag/image.tag

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Fri Dec 3 17:14:06 EST 2004


User:      heins
Date:      2004-12-03 22:14:05 GMT
Modified:  code/SystemTag image.tag
Log:
* Add check-date parameter to allow automatic updating of thumbs when
  source file changes.

  Call with

		[image makesize=100x100 check-date=1 sku="[item-code]"]

  or somesuch.

Revision  Changes    Path
1.12      +15 -4     interchange/code/SystemTag/image.tag


rev 1.12, prev_rev 1.11
Index: image.tag
===================================================================
RCS file: /var/cvs/interchange/code/SystemTag/image.tag,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- image.tag	9 Nov 2004 11:13:04 -0000	1.11
+++ image.tag	3 Dec 2004 22:14:05 -0000	1.12
@@ -1,6 +1,6 @@
 # Copyright 2002, 2004 Interchange Development Group (http://www.icdevgroup.org/)
 # Licensed under the GNU GPL v2. See file LICENSE for details.
-# $Id: image.tag,v 1.11 2004/11/09 11:13:04 docelic Exp $
+# $Id: image.tag,v 1.12 2004/12/03 22:14:05 mheins Exp $
 
 UserTag image Order src
 UserTag image AttrAlias geometry makesize
@@ -167,9 +167,20 @@
 				
 				my $newpath = "$dir/$fn";
 				if(-f $newpath) {
-					$image =~ s:(/?)([^/]+$):$1$siz/$2:;
-					$path = $newpath;
-					last MOGIT;
+					if($opt->{check_date}) {
+						my $mod1 = -M $newpath;
+						my $mod2 = -M $path;
+						unless ($mod2 < $mod1) {
+							$image =~ s:(/?)([^/]+$):$1$siz/$2:;
+							$path = $newpath;
+							last MOGIT;
+						}
+					}
+					else {
+						$image =~ s:(/?)([^/]+$):$1$siz/$2:;
+						$path = $newpath;
+						last MOGIT;
+					}
 				}
 
 				$mask = umask(02);








More information about the interchange-cvs mailing list