#!/usr/bin/perl ###################################### # # Picture View Version 1.45 #version completed December 12, 2000 #Copyright 2000 by Michael K. Goode #This script is free for use and abuse # #The only right I reserve is this header must remain intact (although it can be added to) #The home of this script: http://www.mikegoode.com/web/scripts/ #please check there for any updates or upgrades or bug fixes #my email address: mike@mikegoode.com #if you have any good changes or additions, please email them to me, #and I will add them to the picvu program or add new versions of the program #to my website and credit you. # #I am not responsible for any damage resulting from the use of this program #and I make no guarentees about its performance, specific or implied #I am also not able to help anyone with support #To call this program to view a certain image, link to like this: http://www.mikegoode.com/cgi-#bin/picvu.pl?http://www.mikegoode.com/photo/gallery/mike4/cara-true.jpg&343&435&Cara&medium #the first part (before the ?) is the location of the picvu.pl program. Then is the absolute url location #of the image, and then after an ampersand (&) is the width, then the height, of the image, in pixels #and after the next ampersand is the title of the image #after that, you can put another & and then the size to display the image at, or you can put nothing, and the #image will be displayed at the default size ########################################################### ##Version Info--this version is an upgrade from v1.41--It now includes a javascript link back to the page that ##links to the program -- everything else is the same ########################################################### $bgcolor = "ececec"; # This is the background color for the pages this script creates #in hexadecimal $border = "0"; # This is the size of the border you want around the images. $program = "http://www.mikegoode.com/cgi-bin/picvu.pl"; #This is the absolute url location of the picvu program on your computer #do not put a slash after the file extension (.pl) $small_multiplier = .25; $medium_multiplier = .50; $large_multiplier = .75; #these are the proportions of the full size image #that you will multiply the dimensions by to get #the different size images #use decimals, and not fractions $default_picture_size = 'medium'; #set the default picture size to 'small' , 'medium' , 'large' , or 'full' ######################################## ####You do not need to change anything in this next block#### ######################################## if ($ENV{'QUERY_STRING'} eq "") { exit; } else { $lots_of_info = "$ENV{'QUERY_STRING'}"; #this gets the info from the query string #(the part of the URL after the '?') (@information) = split(/&/, $lots_of_info); #this parses the info into a list called @information $file=shift(@information); $picture_width=shift(@information); $picture_height=shift(@information); $picture_title=shift(@information); &pretty_title; $picture_size=shift(@information); #here the list is split into the individual variables contained in the query string #this next block checks to see the size of the picture that should be displayed #and then adjusts the size of the picture accordingly if($picture_size eq ''){ $picture_size = $default_picture_size; } ##the above statement sets a default picture size if no size is specified if($picture_size eq 'small') { $picture_height_new = $picture_height * $small_multiplier; $picture_width_new = $picture_width * $small_multiplier; } elsif($picture_size eq 'medium') { $picture_height_new = $picture_height * $medium_multiplier; $picture_width_new = $picture_width * $medium_multiplier; } elsif($picture_size eq 'large') { $picture_height_new = $picture_height * $large_multiplier; $picture_width_new = $picture_width * $large_multiplier; } elsif($picture_size eq 'full') { $picture_height_new = $picture_height; $picture_width_new = $picture_width; } else{ $picture_height_new = ""; $picture_width_new = ""; } ##if anything else ends up in the variable $picture_size ##this makes the program just display the full size image ##to prevent it from displaying any weird things ##or crashing or displaying nothing at all; } ################################ ###You do need to change info in this next block.### ################################ $header = <

$display_title

by Michael Goode

EOM 1; # This is where you put the html that goes in the header. Everything MUST # be after and before You DO NOT # need to put a backslash (\) before quotation marks or @ symbols. $footer = < Return to the Previous Page

EOM 1; # This is where you put the html that goes in the footer. Everything MUST # be after and before . You DO NOT # need to put a backslash (\) before quotation marks or @ symbols. # ########################## # Display requested picture print "Content-type: text/html\n\n"; print "$display_title\n"; print "\n"; print "$header\n"; print "



\n"; print "

View at Different Resolutions\n

"; print ""; print ""; print ""; print ""; print ""; print "
"; print "Small"; print "Medium"; print "Large"; print "Full Size


"; print "$footer\n"; print "\n"; exit; ####################### ########################## sub pretty_title { @title = split(/_/, $picture_title); $display_title = join(" ", @title); #the $display_title will be displayed, while the $picture_title will #be used to link back with different sizes } ##############################