Diff for /scripts/pgallery/src/pgallery.sh between versions 1.13 and 1.16

version 1.13, 2012/08/29 12:41:06 version 1.16, 2012/08/29 14:15:50
Line 5 Line 5
 # can do whatever you want with this stuff. If we meet some day, and you think  # can do whatever you want with this stuff. If we meet some day, and you think
 # this stuff is worth it, you can buy me a beer in return Aron Schlesinger  # this stuff is worth it, you can buy me a beer in return Aron Schlesinger
 #  #
# $Paefchen: scripts/pgallery/src/pgallery.sh,v 1.12 2012/08/29 12:30:35 as Exp $# $Paefchen: scripts/pgallery/src/pgallery.sh,v 1.15 2012/08/29 14:15:12 as Exp $
 #  #
   
 ARG_TITLE="PGallery"  ARG_TITLE="PGallery"
Line 33  BIN_EXIFTRAN="/usr/local/bin/exiftran" Line 33  BIN_EXIFTRAN="/usr/local/bin/exiftran"
 BIN_EXIF="/usr/local/bin/exif"  BIN_EXIF="/usr/local/bin/exif"
   
 MKAKEFILE=".htmakefile"  MKAKEFILE=".htmakefile"
VERSION="pgallery-1.2"VERSION="pgallery-1.3"
   
 #  #
 # usage()  # usage()
Line 94  get_my_path() Line 94  get_my_path()
 html_header()  html_header()
 {  {
         cat <<HTML          cat <<HTML
   <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">  <html xmlns="http://www.w3.org/1999/xhtml">
 <head>  <head>
         <title>$ARG_TITLE</title>          <title>$ARG_TITLE</title>
                <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
                <style type="text/css">        <style type="text/css">
                <!--        <!--
 body {  body {
         background-color: #464646;          background-color: #464646;
         background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAABYB\          background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAABYB\
Line 360  html_img() Line 361  html_img()
   
         if [ "$linkb" != "" ]          if [ "$linkb" != "" ]
         then          then
                hlinkb="<a href='$linkb'>back</a>"                hlinkb="<a href='$linkb'>prev</a>"
                 olinkb="<a class='left' style='height:${height}px' href='$linkb'></a>"                  olinkb="<a class='left' style='height:${height}px' href='$linkb'></a>"
         fi          fi
   
         if [ "$linkn" != "" ]          if [ "$linkn" != "" ]
         then          then
                hlinkn="<a href="$linkn">forward</a>"                hlinkn="<a href="$linkn">next</a>"
                 olinkn="<a class='right' style='height:${height}px' href='$linkn'></a>"                  olinkn="<a class='right' style='height:${height}px' href='$linkn'></a>"
         fi          fi
   
Line 374  html_img() Line 375  html_img()
 <div class="box">  <div class="box">
         <div class="nav">          <div class="nav">
                 <div class="top">                  <div class="top">
                        <a href="$link">Index</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="$orig">original</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;$num/$all                        <a href="$link">index</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="$orig">original</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;$num/$all
                 </div>                  </div>
                 <div class="left">$hlinkb</div>                  <div class="left">$hlinkb</div>
                 <div class="right">$hlinkn</div>                  <div class="right">$hlinkn</div>
Line 429  MAIL Line 430  MAIL
 get_exif_desc()  get_exif_desc()
 {  {
         img=$1          img=$1
        $BIN_EXIF --ifd=0 --tag=0x010e -m $img 2> /dev/null | iconv -t ISO-8859-1 -f UTF-8 | while read line        $BIN_EXIF --ifd=0 --tag=0x010e -m $img 2> /dev/null | while read line
         do          do
                 echo "$line<br />"                  echo "$line<br />"
         done          done
Line 566  do Line 567  do
         esac          esac
 done  done
   
   # go to gallery directory
   MY=$(get_my_path)
   cd "$ARG_DIR" || exit 1
   
 # parese info file  # parese info file
 if [ "$ARG_INFOFILE" != "" ]  if [ "$ARG_INFOFILE" != "" ]
 then  then
Line 579  then Line 584  then
         done              done    
 fi  fi
   
# go to gallery directory# paras from iso to utf-8
MY=$(get_my_path)for n in $(set | awk -F= '{print $1}')
cd "$ARG_DIR" || exit 1do
         echo "$n" | grep -q '^ARG_' || continue
         eval "$n=\"\$(echo \"\$$n\" | iconv -f ISO-8859-1 -t UTF-8)\""
 done
   
 # fix url  # fix url
 if [ "$ARG_URL" != "" ]  if [ "$ARG_URL" != "" ]
Line 692  MAKE Line 700  MAKE
 done  done
 echo "tns: $targets" >> $MKAKEFILE  echo "tns: $targets" >> $MKAKEFILE
   
#make -f $MKAKEFILEmake -f $MKAKEFILE
 rm $MKAKEFILE  rm $MKAKEFILE
   
 # create html index  # create html index
Line 747  do Line 755  do
         ) > $imglink          ) > $imglink
 done  done
 echo  echo
   
   # .htaccess
   if [ -f .htaccess ]
   then
           grep -q 'AddCharset UTF-8 .html' < .htaccess || echo "AddCharset UTF-8 .html" >> .htaccess
   else
           echo "AddCharset UTF-8 .html" > .htaccess
   fi
   
 test "$ARG_MAILTO" = "" && exit 0  test "$ARG_MAILTO" = "" && exit 0
   

Removed from v.1.13  
changed lines
  Added in v.1.16