Mercurial > judyates
view perl/make_gallery_js.pl @ 19:792475dd63f3 judyates
fixed problem with images not loadgin
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 22 Jul 2011 13:43:55 -0400 |
parents | b6ba604307fc |
children |
line wrap: on
line source
1 #!/usr/bin/perl4 use File::Find;5 use Set::Object;6 use List::Util 'shuffle';8 use Image::Size;10 $header = <<HERE;11 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">12 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">13 <head>14 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />16 <title>Judy Yates - Prints</title>19 <!--(E)2 Gallery Pro <head> Files-->20 <!--(E)2 Gallery Config FIle-->21 <!--End (E)2 Gallery Config FIle-->22 <!--(E)2 Gallery Style Sheet Link-->24 <link href="firetest.css" rel="stylesheet" type="text/css" />26 <link href="e2gallerypro/design/e2gallerypro/design.css" rel="stylesheet" type="text/css" />28 <script type="text/javascript">29 //modify this path if needed ^ Correlates with Style Sheet Path above30 var designPath="e2gallerypro/design/e2gallerypro/";31 </script>32 <!--End (E)2 Gallery Style Sheet Link-->34 <!--Mootools-->35 <script type="text/javascript" src="e2gallerypro/js/mootools-1.2-core.js"></script>36 <script type="text/javascript" src="e2gallerypro/js/mootools-1.2-more.js"></script>37 <!--End Mootools-->38 <!--(E)2 Gallery Javascript-->40 <script type="text/javascript" src="e2gallerypro/js/setupvars.js"></script>41 <script type="text/javascript">42 var imagesloaded = new Array();43 var maingalleries = new Array();44 <!--(E)2 Gallery Parse XML output Javascript-->45 HERE46 ;49 $footer = <<HERE50 <!--End (E)2 Gallery Parse XML output Javascript-->51 </script> <script type="text/javascript" src="e2gallerypro/js/e2gallerypro.js"></script>53 <!--End (E)2 Gallery Javascript-->54 <!--End (E)2 Gallery Pro </head> Files-->55 </head>56 <body>60 <Title>61 Judy Yates -- Wildlife and Pets on Stone62 </title>64 <span>65 <img src = "./album_pics/3_logo.jpg">66 </span>69 <div class = "menu">70 <ul class = "menu">72 <li class = "menu"><a class = "menu" href = "index.html">( Home</a></li>73 <li class = "menu"><a class = "menu" href = "Meet the Artist2.html">Judy Yates</a></li>74 <li class = "menu"><a class = "menu" href = "Contact.html">Contact )</a></li>75 <li class = "menu"> <a class = "menu" href = "hto.html">( Custom Art</a></li>76 <li class = "menu"><a class = "menu" href = "recent_sales.html">Prints</a></li>77 <li class = "menu"><a class = "menu" href = "photos.html">Photos )</a></li>78 <li class = "menu"><a class = "menu" href = "gallery1.html">( Gallery</a></li>79 <li class = "menu"><a class = "menu" href = "pets1.html">Pets )</a></li>80 </ul>81 </div>83 <div class = "orangebox">88 <!--(E)2 Gallery Pro HTML-->89 <div id="gallerywrapper">90 <div id="gallery">91 <!--Loading Bar-->92 <div id="loading">93 <div id="loadingbar"><img src="e2gallerypro/design/e2gallerypro/loading_hill.gif" width="50" height="50" alt="" id="bar" /></div>94 </div>95 <!--End Loading Bar-->96 <!--Previous Button Div-->97 <div id="previous"></div>99 <!--End Previous Button Div-->100 <!--Next Button Div-->101 <div id="next"></div>102 <!--End Next Button Div-->103 <!--Main Image Holder Div-->104 <div id="images">105 <div id="imagewrap">106 <div id="imgloader"></div>107 </div>109 <div id="imageinfo">110 <div id="infoloader"></div>111 </div>112 <div id="smallmessage"></div>113 </div>114 <!--End Main Image Holder Div-->115 <!--Thumb Box Div-->116 <div id="thumbbox">117 <div id="thumbleft"></div>119 <div id="thumbright"></div>120 <div id="thumbnails">121 <div id="thumbnailwrap"></div>122 </div>123 </div>124 <!--End Thumb Box Div-->125 <!--For Sale Box Div-->126 <div id="fsbox"></div>127 <!--End For Sale Box Div-->129 <!--Galleries Holder Div-->130 <div id="galleries">131 <div id="controls">132 <div class="right"><img src="./e2gallerypro/design/e2gallerypro/gallery_view.png" class="controls" rel=" " id="opengallery" title="View Galleries" border="0" /> <img src="e2gallerypro/design/e2gallerypro/infobox.png" id="showinfo" rel=" " class="controls" title="View Info" border="0" /> <img src="e2gallerypro/design/e2gallerypro/thumbbox.png" id="showthumbbox" title="Toggle Thumbs" class="controls" rel=" " border="0" /></div>133 <span id="slideshow"><img src="e2gallerypro/design/e2gallerypro/play.png" title="Play Slideshow" border="0" align="absmiddle" class="controls" rel=" " /></span> | <span id="photoNum"></span><span id="flashNum"></span><span id="qtNum"></span></div>134 <div id="galleryset"> </div>136 </div>137 <!--End Galleries Holder Div-->138 <!--Thumbnail Pop Up Holder-->139 <div id="thumbnailPopUp"></div>140 <!--End Thumbnail Pop Up Holder-->141 </div>142 </div>148 </div>150 <div class = "menu">151 <ul class = "menu">153 <li class = "menu"><a class = "menu" href = "index.html">( Home</a></li>154 <li class = "menu"><a class = "menu" href = "Meet the Artist2.html">Judy Yates</a></li>155 <li class = "menu"><a class = "menu" href = "Contact.html">Contact )</a></li>156 <li class = "menu"> <a class = "menu" href = "hto.html">( Custom Art</a></li>157 <li class = "menu"><a class = "menu" href = "recent_sales.html">Prints</a></li>158 <li class = "menu"><a class = "menu" href = "photos.html">Photos )</a></li>159 <li class = "menu"><a class = "menu" href = "gallery1.html">( Gallery</a></li>160 <li class = "menu"><a class = "menu" href = "pets1.html">Pets )</a></li>161 </ul>162 </div>164 <div class = "copyright"><br><br>Copyright © 2007 Robert McIntyre. All pictures Copyright © Judy Yates.<br>Special thanks to Dylan Holmes for designing the main banner.</div>169 </body>172 </html>173 HERE174 ;178 $pics = Set::Object->new();180 open PHOTOS, '>/home/r/Desktop/web/judyates/photos.html';181 select PHOTOS;184 @include =185 (186 '/home/r/Desktop/web/judyates/e2gallerypro/e2upload/Galleries/photos/large'187 );190 find(\&accept_type,@include); #grab all the jpeg files192 @pics = $pics->elements();194 #@pics = shuffle(@pics);197 foreach $id(0..$#pics)199 {201 $pics[$id] =~ m/(.*\/)([^\/]*)$/;202 $lrgpath = $1;203 $src = $2;204 $lrgpath =~ m/^(.*\/)[^\/]*\/$/;205 $path = $1;206 $thumbPath = $path."thumbs/";207 $filetype = "image";209 ($width, $height) = imgsize($path.$src);211 ($lrgwidth, $lrgheight) = imgsize($lrgpath.$src);214 $title = $src;215 $author = 'Judy Yates';216 $copyright = 'Copyright Judy Yates Artist 2010';217 $description = $src;218 $forsale = "true";219 $paytype ='paypal';220 $ButtonID = "RAYAWZUUTJ79E";223 $numOfPrices = 3;225 $price1 = '25';226 $pricecurrency1 = 'USD';227 $pricecurrencysymbol1 = '$';228 $pricesize1 = '8"x10" Photo Print';230 $price2 = '35';231 $pricecurrency2 = 'USD';232 $pricecurrencysymbol2 = '$';233 $pricesize2 = '11"x14" Matted Print';235 $price3 = '40';236 $pricecurrency3 = 'USD';237 $pricecurrencysymbol3 = '$';238 $pricesize3 = '11"x14" Signed Matt';244 $imgid = $id;247 $megaString[$id]= "249 {250 'filetype' : '$filetype',251 'ButtonID' : '$ButtonID',252 'path' : '$path',253 'src' : '$src',254 'width' : '$width',255 'height' : '$height',256 'lrgwidth' : '$lrgwidth',257 'lrgheight' : '$lrgheight',258 'lrgpath' : '$lrgpath',259 'title' : '$title',260 'author' : '$author',261 'copyright' : '$copyright',262 'description' : '$description',263 'forsale' : $forsale,264 'paytype' : '$paytype',265 'price1' : '$price1',266 'pricecurrency1' : '$pricecurrency1',267 'pricecurrencysymbol1' : '$pricecurrencysymbol1',268 'pricesize1' : '$pricesize1',270 'price2' : '$price2',271 'pricecurrency2' : '$pricecurrency2',272 'pricecurrencysymbol2' : '$pricecurrencysymbol2',273 'pricesize2' : '$pricesize2',275 'price3' : '$price3',276 'pricecurrency3' : '$pricecurrency3',277 'pricecurrencysymbol3' : '$pricecurrencysymbol3',278 'pricesize3' : '$pricesize3',281 'numOfPrices' : '$numOfPrices',282 'imgid' : $imgid,283 },285 ";287 #print "@megaString";290 #`$command2`;292 }297 $maingalleries = "298 maingalleries =299 [300 {'name':'Judy Yates Photos',301 'imgpath': '$path',302 'lrgpath': '$lrgpath',303 'thumbpath': '$thumbPath',304 'mainthumb': '$path',305 'src':'mainthumb.jpg',306 'description':'Awesome Photos From Judy Yates.',307 'start':0, 'end':$imgid,308 'gallerynum':1}309 ];312 var galleryimages = new Array();314 ";317 print $header;320 $maingalleries =~ s#/home/r/Desktop/web/judyates/#./#g;323 print $maingalleries."\n";325 print "galleryimages = [\n";327 for (@megaString) {328 s#/home/r/Desktop/web/judyates/#./#g;329 print;}331 print "\n];\n";333 print $footer;341 sub accept_type342 {344 /.svn$/ and $File::Find::prune = 1;346 /.jpg$/i and $pics->insert($File::Find::name);351 }