-
-
Save sixstringsg/3880406 to your computer and use it in GitHub Desktop.
Revisions
-
KhasMek revised this gist
Oct 11, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,7 +50,7 @@ ls *.png *.jpg | while read line; do filename=`echo $line | cut -f1 -d "."` (cat << EOF) >> output.html <a href="imgs/space/$line" class="thumb_link"><span class="selected"></span><img src="imgs/space/${filename}_thumb.$extension" title="$name" alt="$name" class="thumb" /></a> EOF done -
KhasMek revised this gist
Oct 10, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,12 +50,12 @@ ls *.png *.jpg | while read line; do filename=`echo $line | cut -f1 -d "."` (cat << EOF) >> output.html <a href="imgs/space/$line" class="thumb_link"><span class="selected"></span><img src="imgs/space/'$filename'_thumb.$extension" title="$name" alt="$name" class="thumb" /></a> EOF done mkdir .thumbs find . ! -name '*.html' ! -name 'khas_is_a_slacker.sh' ! -name '.thumbs' | xargs -i cp {} .thumbs cd .thumbs mogrify -resize 200x200 *.* # add the _small suffix -
KhasMek revised this gist
Oct 10, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ # # Image template creator and thumbnail maker. # # USAGE: ./make_lazy $CUSTOM_TITLE_NAME # If CUSTOM_TITLE_NAME is blank, it will use the actual filename # (with underscores and all). # Currently supported formats are .png and .jpg. @@ -50,7 +50,7 @@ ls *.png *.jpg | while read line; do filename=`echo $line | cut -f1 -d "."` (cat << EOF) >> output.html <a href="imgs/space/$line" class="thumb_link"><span class="selected"></span><img src=\"imgs/space/"$filename"_thumb.$extension\" title="$name" alt="$name" class="thumb" /></a> EOF done -
KhasMek revised this gist
Oct 10, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ # # Image template creator and thumbnail maker. # # USAGE: ./khas_is_a_slacker.sh $CUSTOM_TITLE_NAME # If CUSTOM_TITLE_NAME is blank, it will use the actual filename # (with underscores and all). # Currently supported formats are .png and .jpg. -
KhasMek created this gist
Oct 10, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,71 @@ #!/bin/bash # # Image template creator and thumbnail maker. # # USAGE: ./make_lazy $CUSTOM_TITLE_NAME # If CUSTOM_TITLE_NAME is blank, it will use the actual filename # (with underscores and all). # Currently supported formats are .png and .jpg. # # In addition to most normal linux apps, this script will # require the ImageMagick suit for thumbnail creation. # You can find it here http://www.imagemagick.org/script/index.php # first, check to see if we will use a custom name for the title. if [ ! "$1" ]; then echo "Custom title name not defined." echo "Using actual filename instead." fi # nuke blank spaces rename 'y/ /_/' * # make all folders and filenames lowercase # first, rename all folders (lazy kang from another one of my scripts) for f in `find . -depth ! -name CVS -type d`; do g=`dirname "$f"`/`basename "$f" | tr '[A-Z]' '[a-z]'` if [ "xxx$f" != "xxx$g" ]; then echo "Renaming folder $f" mv -f "$f" "$g" fi done # now, rename all files for f in `find . ! -type d`; do g=`dirname "$f"`/`basename "$f" | tr '[A-Z]' '[a-z]'` if [ "xxx$f" != "xxx$g" ]; then echo "Renaming file $f" mv -f "$f" "$g" fi done # make the html and paste into the output file. ls *.png *.jpg | while read line; do if [ ! "$1" ]; then name=`echo $line | cut -f1 -d "."` else name="$1" fi extension=`echo $line | cut -f2 -d "."` filename=`echo $line | cut -f1 -d "."` (cat << EOF) >> output.html <a href="imgs/space/$line" class="thumb_link"><span class="selected"></span><img src="imgs/space/$filename_thumb.$extension" title="$name" alt="$name" class="thumb" /></a> EOF done mkdir .thumbs find . ! -name '*.html' ! -name 'make_lazy' ! -name '.thumbs' | xargs -i cp {} .thumbs cd .thumbs mogrify -resize 200x200 *.* # add the _small suffix ls | while read line; do extension=`echo $line | cut -f2 -d "."` filename=`echo $line | cut -f1 -d "."` mv $line ../"$filename"_thumb.$extension done # cleanup cd .. rm -rf .thumbs echo "conversion complete..."