#!/bin/sh ## ## SCRIPT: htm00_multi-img-files_thumb-TableCELLS_NperRow_links2originals_echo_for-loop.sh ## ## PURPOSE: Generate an HTML file showing thumbnails of image files IN ROWS ## down the page --- in table rows, N cells per row --- ## using the selected image files ('.jpg', '.gif' or whatever). ## ## METHOD: Uses 'zenity --entry' to prompt for N (the number of cells per row). ## ## Uses 'echo' to build the HTML file. ## ## This script shows the HTML file in an html-viewer of the user's choice ## ($HTMLVIEWER), and puts the user in edit mode on the HTML file ## using a text-editor of the user's choice ($TEXTEDITOR). ## ## HOW TO USE: In Nautilus, select one or more image files in a directory. ## Then right-click and select this script to run (name above). ## ## It is assumed that you have created a subdirectory called ## 'thumbs' in that directory, in which the thumbnail files ## exist and are JPEG files with names with suffixes '_thumb.jpg'. ## ## Examples: ## yada_yada_yada_666x488.jpg ## has thumbnail file ## ./thumbs/yada_yada_yada_666x488_thumb.jpg ## ## and/or (if the original is a GIF file) ## yada_yada_yada_666x488.gif ## has thumbnail file ## ./thumbs/yada_yada_yada_666x488_thumb.jpg ## ############################################################################## ## Started: 2009aug18 ## Updated: 2010jul20 ## Updated: 2011apr12 Converted to a Nautilus script, to gather selected files ## via Nautilus navigation and selection. ## Changed: 2011may11 Get 'nautilus-scripts' directory via an include script. ## Changed: 2011jul07 Changed to handle filenames with embedded spaces. ## (Removed use of FILENAMES var and use a 'for' loop ## WITHOUT the 'in' phrase. Ref: man bash ) ## Changed: 2012may14 Changed script name in comments above and touched up ## the comments. Changed some indenting below. ########################################################################### ## FOR TESTING: (show statements as they execute) # set -x ################################################## ## Set the HTMLVIEWER and TXTEDITOR env vars. ################################################## ## . $HOME/.gnome2/nautilus-scripts/.set_VIEWERvars.shi . $HOME/.freedomenv/feNautilusScripts/set_DIR_NautilusScripts.shi . $DIR_NautilusScripts/.set_VIEWERvars.shi ################################################## ## Get N, the number of image-cells per row. ################################################## CELLSperROW="" CELLSperROW=$(zenity --entry \ --title "N - number of image-cells per row" \ --text "\ ENTER the desired NUMBER of image-cells PER ROW : Typically use 4, 5, or 6 --- depending on the 'thumbnail' image sizes. A '.htm' file will be created in the current directory --- and it will be shown in an HTMLVIEWER: $HTMLVIEWER and it will be shown in a TXTEDITOR: $TXTEDITOR Each of the thumbnails files that you created in the 'thumbs' subdirectory will be a link to the image files in the current directory, if the thumbs are named 'origname__thumb.jpg' for file 'origname.jpg'. You can make the thumbnail files from the selected files by using the '06__multiTHUMBSjpg__4jpgORpngORgifFiles__YPIXhigh.sh' FE Nautilus Script." \ --entry-text "6") if test "$CELLSperROW" = "" then exit fi ################################### ## Set the HTML output file name. ################################### HTMFILE="00_temp_imgTableCells_thumbsAndLinks_${CELLSperROW}perRow.htm" if test -f "$HTMFILE" then rm "$HTMFILE" fi ##################################################### ## Put the (skeleton) 'head', 'title', and 'intro' ## sections in the HTML file. ##################################################### echo "
Title Goes Heresubtitle goes here |
Introduction : Click on a 'thumbnail' image below to see a larger version of the image. The larger image is shown in this same window. Click on the 'Back' button of your web browser to return to this web page.
To download an image, you can right-click on an image and use an option like 'Save Image As ...' in the popup menu of your web browser. |
START of IMAGES :
Bottom of the Title Goes Here page.
To return to a previously visited web page location, click on the
< Go to Start of Images, above. >
|