<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -34,18 +34,18 @@ done
 numfiles=0
 for filename in *.[jJ][pP][gG]; do
 	debug &amp;&amp; echo -n &quot;$filename: &quot;
-	$jhead -autorot $filename 2&gt;/dev/null | grep ^Modified: &gt;/dev/null &amp;&amp; echo -n &quot;rotated &quot;
-	[[ -s $thumbdir/$filename ]] || $convert -scale x$thumby $filename $thumbdir/$filename || continue
+	$jhead -autorot &quot;$filename&quot; 2&gt;/dev/null | grep ^Modified: &gt;/dev/null &amp;&amp; echo -n &quot;rotated &quot;
+	[[ -s $thumbdir/$filename ]] || $convert -scale x$thumby &quot;$filename&quot; &quot;$thumbdir/$filename&quot; || continue
 	filelist[$numfiles]=$filename
 	let numfiles++
 	for res in ${heights[*]}; do
 		debug &amp;&amp; echo -n &quot;$res &quot;
 		if [[ ! -s .$res/$filename ]]; then
-			$convert -scale x$res $filename .$res/$filename
-			$fadvise .$res/$filename 2&gt;/dev/null
+			$convert -scale x$res &quot;$filename&quot; &quot;.$res/$filename&quot;
+			$fadvise &quot;.$res/$filename&quot; 2&gt;/dev/null
 		fi
 	done
-	$fadvise $filename 2&gt;/dev/null
+	$fadvise &quot;$filename&quot; 2&gt;/dev/null
 	debug &amp;&amp; echo
 done
 
@@ -56,7 +56,7 @@ sheet=0 cury=0 curx=0 file=0
 while [[ $file -lt $numfiles ]]; do
 	filename=${filelist[$file]}
 	thumb=$thumbdir/$filename
-	twidth=$($jhead $thumb 2&gt;/dev/null | grep ^Res  | awk '{print $3}')
+	twidth=$($jhead &quot;$thumb&quot; 2&gt;/dev/null | awk '($1 == &quot;Resolution&quot;) {print $3}')
 
 	# generate the thumbnail sheets
 	if [[ $((curx + twidth)) -gt $sheetx ]]; then
@@ -73,7 +73,7 @@ while [[ $file -lt $numfiles ]]; do
 		fi
 	fi
 	debug &amp;&amp; echo -n &quot;$filename &quot;
-	$convert +append $tmprow $thumb $tmprow 2&gt;/dev/null
+	$convert +append $tmprow &quot;$thumb&quot; $tmprow 2&gt;/dev/null
 
 	# generate the html in .1024/.html/file.jpg.html
 	for res in ${heights[*]}; do
@@ -81,30 +81,29 @@ while [[ $file -lt $numfiles ]]; do
 		[[ $file -ne 0 ]] &amp;&amp; prev=${filelist[$((file - 1))]}
 		[[ $file -ne $((numfiles - 1)) ]] &amp;&amp; next=${filelist[$((file + 1))]}
 		htmlfile=.$res/.html/$filename.html
-		xsize=$($jhead .$res/$filename 2&gt;/dev/null | grep ^Res  | awk '{print $3}')
-		cat &gt;$htmlfile &lt;&lt;EOF
+		xsize=$($jhead &quot;.$res/$filename&quot; 2&gt;/dev/null | awk '($1 == &quot;Resolution&quot;) {print $3}')
+		cat &gt;&quot;$htmlfile&quot; &lt;&lt;EOF
 &lt;html&gt;&lt;head&gt;&lt;title&gt;$filename&lt;/title&gt;
 &lt;script language=&quot;JavaScript&quot;&gt;
 prev=new Image();
 next=new Image();
 function f(){
 EOF
-		[[ $prev ]] &amp;&amp; echo &quot;prev.src='../$prev';&quot; &gt;&gt;$htmlfile
-		[[ $next ]] &amp;&amp; echo &quot;next.src='../$next';&quot; &gt;&gt;$htmlfile
-		cat &gt;&gt;$htmlfile &lt;&lt;EOF
+		[[ $prev ]] &amp;&amp; echo &quot;prev.src='../$prev';&quot; &gt;&gt;&quot;$htmlfile&quot;
+		[[ $next ]] &amp;&amp; echo &quot;next.src='../$next';&quot; &gt;&gt;&quot;$htmlfile&quot;
+		cat &gt;&gt;&quot;$htmlfile&quot; &lt;&lt;EOF
 }
 &lt;/script&gt;&lt;/head&gt;&lt;body onLoad=&quot;f()&quot;&gt;
 &lt;a href='../../.$res.$index'&gt;^ up to thumbnails ^&lt;/a&gt; 
 EOF
-		[[ $prev ]] &amp;&amp; echo &quot;&lt;a href=$prev.html&gt;&amp;lt;- prev&lt;/a&gt; &quot; &gt;&gt;$htmlfile || echo -n &quot;&amp;lt;- prev &quot; &gt;&gt;$htmlfile
-		[[ $next ]] &amp;&amp; echo &quot;&lt;a href=$next.html&gt;next -&amp;gt;&lt;/a&gt; &quot; &gt;&gt;$htmlfile || echo -n &quot;next -&amp;gt; &quot; &gt;&gt;$htmlfile
+		[[ $prev ]] &amp;&amp; echo &quot;&lt;a href='$prev.html'&gt;&amp;lt;- prev&lt;/a&gt; &quot; &gt;&gt;&quot;$htmlfile&quot; || echo -n &quot;&amp;lt;- prev &quot; &gt;&gt;&quot;$htmlfile&quot;
+		[[ $next ]] &amp;&amp; echo &quot;&lt;a href='$next.html'&gt;next -&amp;gt;&lt;/a&gt; &quot; &gt;&gt;&quot;$htmlfile&quot; || echo -n &quot;next -&amp;gt; &quot; &gt;&gt;&quot;$htmlfile&quot;
 		for size in ${heights[*]}; do
 			[[ $size == $res ]] &amp;&amp; echo -n &quot;$size &quot; || echo -n &quot;&lt;a href='../../.$size/.html/$filename.html'&gt;$size&lt;/a&gt; &quot;
-		done &gt;&gt;$htmlfile
-		echo &quot;&lt;p&gt;&lt;a href=&quot;../../$filename&quot;&gt;&lt;img border=0 width=$xsize height=$res src=../$filename&gt;&lt;/a&gt;&lt;p&gt;&quot; &gt;&gt;$htmlfile
-		$jhead $filename 2&gt;/dev/null | sed 's/$/&lt;br&gt;/' &gt;&gt;$htmlfile
-		echo '&lt;hr&gt;&lt;font size=&quot;-1&quot;&gt;Generated by &lt;a href=&quot;http://shapor.com/bashgal&quot;&gt;bashgal&lt;/a&gt;&lt;/font&gt;&lt;/body&gt;' &gt;&gt;$htmlfile
-		#generate the 600.index.html
+		done &gt;&gt;&quot;$htmlfile&quot;
+		echo &quot;&lt;p&gt;&lt;a href=&quot;../../$filename&quot;&gt;&lt;img border=0 width=$xsize height=$res src='../$filename'&gt;&lt;/a&gt;&lt;p&gt;&quot; &gt;&gt;&quot;$htmlfile&quot;
+		$jhead &quot;$filename&quot; 2&gt;/dev/null | sed 's/$/&lt;br&gt;/' &gt;&gt;&quot;$htmlfile&quot;
+		echo '&lt;hr&gt;&lt;font size=&quot;-1&quot;&gt;Generated by &lt;a href=&quot;http://shapor.com/bashgal&quot;&gt;bashgal&lt;/a&gt;&lt;/font&gt;&lt;/body&gt;' &gt;&gt;&quot;$htmlfile&quot;
 		echo &quot;&lt;div style='width:${twidth}px'&gt;&lt;a href='.$res/.html/$filename.html'&gt;&lt;img border=0 alt='$filename' src='$sheetdir/$sheet.jpg' style='left:-${curx}px;top:-${cury}px;position:absolute'&gt;&lt;/a&gt;&lt;/div&gt;&quot; &gt;&gt;$tmpindex.$res
 	done
 </diff>
      <filename>bashgal</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e180c5cdf0033ce91d31d1f74545cbd6d2b68ed9</id>
    </parent>
  </parents>
  <author>
    <name>Shapor Naghibzadeh</name>
    <email>shapor@yzf.shapor.com</email>
  </author>
  <url>http://github.com/shapor/bashgal/commit/ae9335edb46d5474d9d27b9cde61f68164d7dd5b</url>
  <id>ae9335edb46d5474d9d27b9cde61f68164d7dd5b</id>
  <committed-date>2009-03-25T17:31:08-07:00</committed-date>
  <authored-date>2009-03-25T17:31:08-07:00</authored-date>
  <message>Fix quoting to deal with filenames with space.
Remove spurious historical comment dropping.
Extract resolution from jhead somewhat more intelligently.</message>
  <tree>3c4b0199c7ca9359d31051c37f9cdd536c142954</tree>
  <committer>
    <name>Shapor Naghibzadeh</name>
    <email>shapor@yzf.shapor.com</email>
  </committer>
</commit>
