On Apr 19, 2007, at 12:46, E David Miller wrote:

Any of which would be easier than my own solution, which would be to put them up in a MySQL database and write PHP and JavaScript for a slideshow page. :) But admittedly, my version would make more use of BBEdit.


I wrote a little perl script in BBEdit that forms up web pages for a folder of images into a slide show. Is this something you had in mind?
#!/usr/bin/perl -w
#
#	script to make a web slide show of a directory of images
#
#

use strict;

my ($dirStart, $dirSep, $currentDir, $parentDir, $rootDir, $defaultRootDir, $imageDir, $imageSubDir);
my ($copyright, $infile, $slideTitle, $captions, $caption);
my ($cnt, @allFiles, $imageCnt, @imageFiles, $lastChar);

$dirStart = "";
$dirSep = "/";
$currentDir = ".";
$parentDir = "..";


$copyright = "<hr>&copy;1996 - 2006 <a href=\"http://www.duke.edu/~madil001/\";>James Madill</a>\n";

$rootDir = $currentDir . $dirSep;
$defaultRootDir = "~/Desktop/photos/";
$imageDir = "images";

print "Enter directory to generate slide show [$defaultRootDir]: ";
$infile = <STDIN>;
chomp ($infile);

if ($infile eq ""){
	$infile = $defaultRootDir;
	print "    nothing entered...\n";
}
if (substr($infile,0,2) eq "~/"){
	$infile = $ENV{'HOME'} . $dirSep . substr($infile,2)
}
$rootDir = $infile;
$lastChar = chop($rootDir);
if ($lastChar eq $dirSep){
	$rootDir .= $lastChar;
}else{
	$rootDir .= $lastChar . $dirSep;
}

print "Enter subdirectory photos are in [$imageDir]: ";
$infile = <STDIN>;
chomp ($infile);
if ($infile ne ""){
	$imageDir = $infile;
}
$lastChar = chop($imageDir);
if ($lastChar ne $dirSep){
	$imageDir .= $lastChar;
}

print "Enter title of slide show: ";
$slideTitle = <STDIN>;
chomp ($slideTitle);

print "You can include a placeholder in the files for adding captions later.\n";
print "Include provision for captions? y/n [y]:";
$captions = <STDIN>;
chomp ($captions);
if ($captions eq "n"){
	$caption = "";
}else{
	$caption = "<h3>caption</h3>\n\n";
}

$imageSubDir = $rootDir . $imageDir;
opendir(dirHandle, "$imageSubDir");
@allFiles = readdir(dirHandle);
closedir(dirHandle);
@allFiles = sort(@allFiles);
$imageCnt = 0;
for($cnt=0;$cnt<@allFiles;$cnt++){					# find appropriate (image) files
	if (substr($allFiles[$cnt], 0, 1) ne "."){
		$imageFiles[$imageCnt++] = $allFiles[$cnt];
	}
}

if ($imageCnt){
	&GenerateIndexPage($rootDir, $slideTitle, $imageCnt);
	
	for($cnt=0;$cnt<$imageCnt;$cnt++){
		&GenerateSlidePages($rootDir, $imageDir, $slideTitle, $imageFiles[$cnt], $cnt+1, $imageCnt);
	}
}else{
	print "ERROR - No image files exist in: $imageSubDir\n";
}
print "\nfini...\n";



sub GenerateIndexPage(){
	# generate a home, starting page for slide show.
	my ($parentDir, $title, $imageCnt) = @_;
	my ($cnt, $webPage);
	
	$webPage = $parentDir . "index.html";
	print "\tgenerating page $webPage.\n";
	open (INDEX, ">$webPage");
	print (INDEX "<html>\n<head>\n<title>$title</title>\n</head>\n<body>\n\n");
	print (INDEX "<center>\n<h1>$title</h1>\n");
	
	print (INDEX "<br>\n<br>\n\nThere are $imageCnt images in this slide show.<br>\n");
	print (INDEX "You can click on an image to view the full sized version.<br>\n\n");
	
	print (INDEX "<br>\n<br>\n<h2><a href=\"slide-1.html\">Begin Show</a><h2>\n");
	
	print (INDEX "<hr width=\"75%\">\n");
	print (INDEX "<h2>or jump to a specific image:<h2>\n");
	print (INDEX "<blockquote><blockquote><font size=\"+2\">\n");
	for ($cnt=1;$cnt<=$imageCnt;$cnt++){
		print (INDEX "<a href=\"slide-$cnt.html\">$cnt</a>, ");
	}
	print (INDEX "</font></blockquote></blockquote>\n");
	
	print (INDEX "</center>\n");
	print (INDEX "$copyright");
	print (INDEX "\n</body>\n</html>\n");
	close (INDEX);
}	# GenerateIndexPage


sub GenerateSlidePages(){
	my ($parentDir, $subdir, $title, $imageFile, $currentImage, $imageCnt) = @_;
	my ($imgHeight, $nextImg, $prevImg, $prevPage, $webPage);
	
	$imgHeight = 480;
	$webPage = $parentDir . "slide-" . $currentImage . ".html";
	print "\tgenerating page $webPage for $currentImage.\n";
	open (SLIDE, ">$webPage");
	print (SLIDE "<html>\n<head>\n<title>$title - slide $currentImage</title>\n</head>\n<body>\n\n");
	print (SLIDE "<center>\n<h1>$title</h1>\n");
	print (SLIDE "<font size=\"-1\">click image to view it full size.</font><br>\n\n");
	print (SLIDE "Slide $currentImage of $imageCnt<br>\n");

	print (SLIDE "$caption");
	
	print (SLIDE "<table border=\"12\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"0000ff\"><tr><td>");
#	print (SLIDE "<a href=\"$subdir$dirSep$imageFile\"><img src=\"$subdir$dirSep$imageFile\" height=\"$imgHeight\"></a>");
	print (SLIDE "<a href=\"$subdir$dirSep$imageFile\" target=\"fullsize\"><img src=\"$subdir$dirSep$imageFile\" height=\"$imgHeight\"></a>");
	print (SLIDE "</td></tr></table>");
	
	$prevImg = $currentImage - 1;
	if ($prevImg){
		$prevPage = "slide-" . $prevImg . ".html";
	}else{
		$prevPage = "index.html";
	}
	print (SLIDE "<h2><a href=\"index.html\">Beginning</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"$prevPage\">Previous</a>");
	
	if ($currentImage < $imageCnt){
		$nextImg = $currentImage + 1;
		print (SLIDE "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"slide-$nextImg.html\">Next</a>");
	}
	print (SLIDE "</h2>\n</center>\n");
	print (SLIDE "$copyright");
	print (SLIDE "\n</body>\n</html>\n");
	close (SLIDE);
#	print "\t$subdir$dirSep$imageFile\n";
}	# GenerateSlidePages



On Apr 19, 2007, at 12:35 PM, Daryl Spitzer wrote:

Or you could get yourself a (free) Flickr (flickr.com) account, upload
your photos there and link to their nifty slideshow URL.

--
Daryl


On 4/19/07, Robert Simmons <[EMAIL PROTECTED]> wrote:
Sounds like you should try Photoshop's "File/Automate/Web Photo Gallery..."

John Church wrote:
> I have about 30 slides I would like to post to our web site and display
> them as a slideshow.
>
> I would like it to display in a browser that would show properly on both
> Macs and PCs.
>
> Can I do this directly in BBEdit? I have perused the help and user
> guide several times, but can not find a direct way to do it.
>
> Failing that, I thought a fall-back position would be to use iMovie to > create a movie of the images, and convert it to a QuickTime movie. If
> the above (slideshow) won't work, how do I do the QT posting?
>
> Or can anyone point me to a web site for info on how to do these things?
>
> Thanks,
>
>  -- John
>

--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>



--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>




--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>


James Madill
[EMAIL PROTECTED]


-- 
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to