From: Francesco M. <fr...@us...> - 2006-12-22 18:41:45
|
Update of /cvsroot/wxlua/website In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11149 Modified Files: screenshots.php updateluasample.sh updatethumbs.sh Log Message: rewritten updatethumbs to use the 'convert' utility of ImageMagick toolsuite (easier to use and more reliable); updated all thumbs Index: updatethumbs.sh =================================================================== RCS file: /cvsroot/wxlua/website/updatethumbs.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** updatethumbs.sh 5 Mar 2006 09:52:35 -0000 1.1 --- updatethumbs.sh 22 Dec 2006 18:41:40 -0000 1.2 *************** *** 1,49 **** ! #!/usr/bin/php -q ! <?php ! ! require_once('phpThumb/phpthumb.class.php'); ! ! // create 3 sizes of thumbnail ! foreach (glob("screenshots/*.png") as $filename) { ! echo "Processing $filename (size: " . (int)(filesize($filename)/1024) . " KB)...\n"; ! ! // Note: If you want to loop through and create multiple ! // thumbnails from different image sources, you should ! // create and dispose an instance of phpThumb() each time ! // through the loop and not reuse the object. ! $phpThumb = new phpThumb(); ! ! // set data ! $phpThumb->setSourceFilename($filename); ! // set parameters (see "URL Parameters" in phpthumb.readme.txt) ! $phpThumb->w = 100; ! // set options (see phpThumb.config.php) ! // here you must preface each option with "config_" ! $phpThumb->config_output_format = 'png'; ! // generate & output thumbnail ! $output_filename = 'thumbnails/' . basename($filename); ! if ($phpThumb->GenerateThumbnail()) { // this line is VERY important, do not remove it! ! if ($output_filename) { ! if ($phpThumb->RenderToFile($output_filename)) { ! // do something on success ! echo " ...rendered as $output_filename (size: " . (int)(filesize($output_filename)/1024) . " KB)\n"; ! } else { ! // do something with debug/error messages ! echo " ...failed:".implode("\n\n", $phpThumb->debugmessages)."\n"; ! } ! } else { ! //$phpThumb->OutputThumbnail(); ! } ! } else { ! // do something with debug/error messages ! echo " ...failed:".implode("\n\n", $phpThumb->debugmessages)."\n"; ! } ! // remember to unset the object each time through the loop ! unset($phpThumb); ! } ! ?> \ No newline at end of file --- 1,30 ---- ! #!/bin/bash ! test=`convert --version >/dev/null 2>&1` ! if [ "$?" != "0" ]; then ! echo Cannot find the 'convert' executable which is required; >&2 ! echo download and install it from http://www.imagemagick.org/script/index.php >&2 ! exit 1 ! fi ! # uses the very good source highlighting package which can be ! # downloaded from: ! # http://www.gnu.org/software/src-highlite/ ! # (Some Linux distro do package it in binary form) ! for filename in `ls screenshots/*.png`; do ! size=`du -h $filename | awk '{print $1;}'` ! echo "Processing $filename (size: $size)..." ! # generate & output thumbnail ! output_filename="thumbnails/`basename $filename`"; ! convert $filename -resize 100 $output_filename ! if test $? = 0; then ! size=`du -h $output_filename | awk '{print $1;}'` ! echo " ...rendered as $output_filename (size: $size)..."; ! else ! echo "Thumbnail generation failed. Stopping." ! exit 1 ! fi ! done Index: updateluasample.sh =================================================================== RCS file: /cvsroot/wxlua/website/updateluasample.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** updateluasample.sh 5 Mar 2006 09:52:34 -0000 1.2 --- updateluasample.sh 22 Dec 2006 18:41:40 -0000 1.3 *************** *** 11,14 **** # downloaded from: # http://www.gnu.org/software/src-highlite/ ! # source-highlight -s lua -f xhtml luasample.lua --- 11,14 ---- # downloaded from: # http://www.gnu.org/software/src-highlite/ ! # (Some Linux distro do package it in binary form) source-highlight -s lua -f xhtml luasample.lua Index: screenshots.php =================================================================== RCS file: /cvsroot/wxlua/website/screenshots.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** screenshots.php 22 Dec 2006 13:54:09 -0000 1.15 --- screenshots.php 22 Dec 2006 18:41:40 -0000 1.16 *************** *** 6,10 **** include_once("header.inc.php"); ! function write_screenshot($url, $title) { echo "<a href='screenshots/$url'>"; echo "<img src='thumbnails/$url' style='float:inherit' alt='$title' title='$title'/>"; --- 6,11 ---- include_once("header.inc.php"); ! function write_screenshot($url, $title) ! { echo "<a href='screenshots/$url'>"; echo "<img src='thumbnails/$url' style='float:inherit' alt='$title' title='$title'/>"; *************** *** 17,23 **** <div style="text-align: center"> <?php ! write_screenshot("wxluacan_win.png", "The wxLuaCan sample (in wxMSW)"); ! write_screenshot("wxluaedit_scribble_win.png", "The scribble sample and wxLuaEdit showing scribble sources (in wxMSW)"); ! write_screenshot("wxlua_miscsamples_win.png", "Some miscellaneous samples (in wxMSW)"); ?> </div> --- 18,27 ---- <div style="text-align: center"> <?php ! write_screenshot("wxluacan_win.png", ! "The wxLuaCan sample (in wxMSW)"); ! write_screenshot("wxluaedit_scribble_win.png", ! "The scribble sample and wxLuaEdit showing scribble sources (in wxMSW)"); ! write_screenshot("wxlua_miscsamples_win.png", ! "Some miscellaneous samples (in wxMSW)"); ?> </div> *************** *** 29,36 **** <div style="text-align: center"> <?php ! write_screenshot("wxluacan_gtk2.png", "The wxLuaCan sample (in wxGTK2)"); ! write_screenshot("wxluaedit_scribble_gtk2.png", "The scribble sample and wxLuaEdit showing scribble sources (in wxGTK2)"); ! write_screenshot("wxlua_miscsamples_gtk2.png", "Some miscellaneous samples (in wxGTK2)"); ! write_screenshot("wxlua_sudoku_gtk2.png", "wxLuaSudoku (in wxGTK2)"); ?> </div> --- 33,44 ---- <div style="text-align: center"> <?php ! write_screenshot("wxluacan_gtk2.png", ! "The wxLuaCan sample (in wxGTK2)"); ! write_screenshot("wxluaedit_scribble_gtk2.png", ! "The scribble sample and wxLuaEdit showing scribble sources (in wxGTK2)"); ! write_screenshot("wxlua_miscsamples_gtk2.png", ! "Some miscellaneous samples (in wxGTK2)"); ! write_screenshot("wxlua_sudoku_gtk2.png", ! "wxLuaSudoku (in wxGTK2)"); ?> </div> *************** *** 40,47 **** <div style="text-align: center"> <?php ! write_screenshot("wxluacan_mac.png", "The wxLuaCan sample (in wxMac)"); ! write_screenshot("wxluaedit_scribble_mac.png", "The scribble sample and wxLuaEdit showing scribble sources (in wxMac)"); ! write_screenshot("wxlua_miscsamples_mac.png", "Some miscellaneous samples (in wxMac)"); ! write_screenshot("wxlua_sudoku_mac.png", "wxLuaSudoku (in wxMac)"); ?> </div> --- 48,59 ---- <div style="text-align: center"> <?php ! write_screenshot("wxluacan_mac.png", ! "The wxLuaCan sample (in wxMac)"); ! write_screenshot("wxluaedit_scribble_mac.png", ! "The scribble sample and wxLuaEdit showing scribble sources (in wxMac)"); ! write_screenshot("wxlua_miscsamples_mac.png", ! "Some miscellaneous samples (in wxMac)"); ! write_screenshot("wxlua_sudoku_mac.png", ! "wxLuaSudoku (in wxMac)"); ?> </div> |