...ightroom/Web Galleries/Impact.lrwebengine/photo.html:116: attempt to index global 'image' (a nil value)

...ightroom/Web Galleries/Impact.lrwebengine/photo.html:116: attempt to index global 'image' (a nil value)

Switch View
  • ...ightroom/Web Galleries/Impact.lrwebengine/photo.html:116: in main chunk
  1. <%
  2. local mySize = "large"
  3. local theRoot = "."
  4. local resolution = "";
  5. if (model.nonCSS.images_large.export) then resolution = "max" end
  6. if (model.nonCSS.images_medium.export and resolution == "") then resolution = "medium" end
  7. if (model.nonCSS.images_small and resolution == "") then resolution = "small" end
  8. local folder = "photos_" .. resolution
  9. %>
  10. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  11. "http://www.w3.org/TR/html4/loose.dtd">
  12. <html>
  13. <!-- This gallery has been generated using the 'Impact' Web Engine for Lightroom 2. See http://www.photographers-toolbox.com/ for more information -->
  14. <head>
  15. <title>$model.metadata.pageTitle.value</title>
  16. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  17. <meta name="description" content="$model.metadata.description.value">
  18. <meta name="viewport" content="user-scalable=no, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5">
  19. <link rel="stylesheet" type="text/css" media="screen" title="Custom Settings" href="$theRoot/resources/custom.css" >
  20. <link rel="stylesheet" type="text/css" media="screen" href="$theRoot/resources/mainstyles.css">
  21. <link media="only screen and (max-device-width: 480px)" href="$theRoot/resources/smallscreen.css" type= "text/css" rel="stylesheet">
  22. <!-- Redirect this static page to the Javascript version if scripting is now enabled -->
  23. <script type="text/javascript" src="$theRoot/resources/mootools-1.2.4-core-yc.js"></script>
  24. <script type="text/javascript" src="$theRoot/resources/mootools-1.2.4.4-more.js"></script>
  25. <script type="text/javascript"><!--
  26. var uri = new URI(window.location);
  27. var filename = uri.get('file');
  28. var imagename = filename.substring(0, filename.length - 5);
  29. window.location.replace("index.html#" + imagename);
  30. --></script>
  31. <style type="text/css">
  32. #prevbutton1 { border-color: #000000 #FFFFFF #000000 #000000 }
  33. #prevbutton2 { border-color: #FFFFFF #000000 #FFFFFF #000000 }
  34. #nextbutton1 { border-color: #FFFFFF #000000 #FFFFFF #000000 }
  35. #nextbutton2 { border-color: #000000 #000000 #000000 #FFFFFF }
  36. #playbutton1 { border-color: #000000 #000000 #000000 #FFFFFF }
  37. #playbutton2 { border-color: #FFFFFF }
  38. #pausebutton1 { border-color: #FFFFFF }
  39. #playbutton1 { border-color: <%= model.nonCSS.playbutton1borderColor %> }
  40. #playbutton2 { border-color: <%= model.nonCSS.playbutton2borderColor %> }
  41. #nextbutton1 { border-color: <%= model.nonCSS.nextbutton1borderColor %> }
  42. #nextbutton2 { border-color: <%= model.nonCSS.nextbutton2borderColor %> }
  43. #prevbutton1 { border-color: <%= model.nonCSS.prevbutton1borderColor %> }
  44. #prevbutton2 { border-color: <%= model.nonCSS.prevbutton2borderColor %> }
  45. #pausebutton1 { border-color: <%= model.nonCSS.pausebuttonBorderColor %> }
  46. </style>
  47. <!--[if lt IE 7]>
  48. <% if mode ~= 'preview' then %>
  49. <link href="$theRoot/pngfix.css" media="screen" rel="stylesheet" type="text/css" />
  50. <% end %>
  51. <![endif]-->
  52. </head>
  53. <body>
  54. <%
  55. local loadingdots='<div class="loading">'
  56. local n
  57. for n = 1, model.nonCSS.loadingdots.number do
  58. loadingdots = loadingdots .. "<span>·</span>"
  59. end
  60. loadingdots = loadingdots .. "</div>"
  61. %>
  62. <div id="beltcontainer">
  63. <div id="belt">
  64. <%
  65. if model.nonCSS.fittingType == "width" then
  66. fitClass = "fithorizontal"
  67. elseif model.nonCSS.fittingType == "height" then
  68. fitClass = "fitvertical"
  69. else
  70. -- We scale based on the orientation of the photo.
  71. --
  72. -- To do that we need to find a resolution that was actually exported...
  73. image = getImage(index)
  74. if model.nonCSS.images_large.export then
  75. width = image.renditions.large.width
  76. height = image.renditions.large.height
  77. elseif model.nonCSS.images_medium.export then
  78. width = image.renditions.medium.width
  79. height = image.renditions.medium.height
  80. else
  81. width = image.renditions.small.width
  82. height = image.renditions.small.height
  83. end
  84. if width > height then
  85. fitClass = "fithorizontal"
  86. else
  87. fitClass = "fitvertical"
  88. end
  89. end
  90. %>
  91. <div class="beltobjectwrapper <%= fitClass %>"><div class="beltobjectcenterer"><div class="beltobject"><img src="<%= folder .. "/" .. image.exportFilename %>.jpg"></div></div></div>
  92. </div>
  93. </div>
  94. <% if model.nonCSS.displayIdentityPlate then
  95. if #model.nonCSS.identityPlateLink > 0 then %>
  96. <div id="logo"><a href="<%= model.nonCSS.identityPlateLink %>"><img src="$theRoot/resources/logo.png" alt=""></a></div>
  97. <% else %>
  98. <div id="logo"><img src="$theRoot/resources/logo.png"></div>
  99. <% end %>
  100. <% end %>
  101. <div id="menu">
  102. <table cellspacing="0" cellpadding="0" border="0">
  103. <tr>
  104. <td class="menubarpadding"></td>
  105. <td id="menuitems">
  106. <ul>
  107. <% if model.nonCSS.menuitems.one.included then %><li><a href="<%= model.nonCSS.menuitems.one.url %>"><%= model.nonCSS.menuitems.one.title %></a></li><% end %>
  108. <% if model.nonCSS.menuitems.two.included then %><li><a href="<%= model.nonCSS.menuitems.two.url %>"><%= model.nonCSS.menuitems.two.title %></a></li><% end %>
  109. <% if model.nonCSS.menuitems.three.included then %><li><a href="<%= model.nonCSS.menuitems.three.url %>"><%= model.nonCSS.menuitems.three.title %></a></li><% end %>
  110. <% if model.nonCSS.menuitems.four.included then %><li><a href="<%= model.nonCSS.menuitems.four.url %>"><%= model.nonCSS.menuitems.four.title %></a></li><% end %>
  111. <% if model.nonCSS.menuitems.five.included then %><li><a href="<%= model.nonCSS.menuitems.five.url %>"><%= model.nonCSS.menuitems.five.title %></a></li><% end %>
  112. </ul>
  113. </td>
  114. <% if model.nonCSS.controlsEnabled then %>
  115. <lr:Pagination>
  116. <lr:PreviousEnabled>
  117. <td class="control">
  118. <div class="controlContainer" id="prevbutton">
  119. <table cellspacing="0" cellpadding="0" border="0" align="center"><tr><td class="controlbit"><a href="$link" id="prevbutton1" class="slant"><!-- --></a></td><td class="controlbit"><a href="$link" id="prevbutton2" class="slant"><!-- --></a></td></tr></table>
  120. </div>
  121. </td>
  122. <td class="control"></td>
  123. </lr:PreviousEnabled>
  124. <lr:NextEnabled>
  125. <td class="control">
  126. <div class="controlContainer" id="nextbutton">
  127. <table cellspacing="0" cellpadding="0" border="0" align="center"><tr><td class="controlbit"><a href="$link" id="nextbutton1"class="slant"><!-- --></a></td><td class="controlbit"><a href="$link" id="nextbutton2" class="slant"><!-- --></a></td></tr></table>
  128. </div>
  129. </td>
  130. <td class="menubarpadding"></td>
  131. </lr:NextEnabled>
  132. </lr:Pagination>
  133. <% end %>
  134. </tr>
  135. </table>
  136. </div>
  137. <% if model.nonCSS.dots.enabled then %>
  138. <div id="dotswrapper">
  139. <div id="dots"><% for d = 1, numImages do %><a <% if d == index then write('class="selected"') end %> <% if d == 1 then write('class="first"') end %> href="<%= getImage(d).exportFilename %>.html"><% if model.nonCSS.dots.type == "squares" then write("" .. d) else write ('·') end%></a><% end %></div>
  140. </div>
  141. <% end %>
  142. <div id="pr1"><img src="resources/blank.gif"></div>
  143. <div id="pr2"></div>
  144. <% --[[ Include the page footer]] %>
  145. </body>
  146. </html>
  1. local mySize = "large"
  2. local theRoot = "."
  3. local resolution = "";
  4. if (model.nonCSS.images_large.export) then resolution = "max" end
  5. if (model.nonCSS.images_medium.export and resolution == "") then resolution = "medium" end
  6. if (model.nonCSS.images_small and resolution == "") then resolution = "small" end
  7. local folder = "photos_" .. resolution
  8. write( [[
  9. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  10. "http://www.w3.org/TR/html4/loose.dtd">
  11. <html>
  12. <!-- This gallery has been generated using the 'Impact' Web Engine for Lightroom 2. See http://www.photographers-toolbox.com/ for more information -->
  13. <head>
  14. <title>]] )write( model.metadata.pageTitle.value )write( [[</title>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  16. <meta name="description" content="]] )write( model.metadata.description.value )write( [[">
  17. <meta name="viewport" content="user-scalable=no, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5">
  18. <link rel="stylesheet" type="text/css" media="screen" title="Custom Settings" href="]] )write( theRoot )write( [[/resources/custom.css" >
  19. <link rel="stylesheet" type="text/css" media="screen" href="]] )write( theRoot )write( [[/resources/mainstyles.css">
  20. <link media="only screen and (max-device-width: 480px)" href="]] )write( theRoot )write( [[/resources/smallscreen.css" type= "text/css" rel="stylesheet">
  21. <!-- Redirect this static page to the Javascript version if scripting is now enabled -->
  22. <script type="text/javascript" src="]] )write( theRoot )write( [[/resources/mootools-1.2.4-core-yc.js"></script>
  23. <script type="text/javascript" src="]] )write( theRoot )write( [[/resources/mootools-1.2.4.4-more.js"></script>
  24. <script type="text/javascript"><!--
  25. var uri = new URI(window.location);
  26. var filename = uri.get('file');
  27. var imagename = filename.substring(0, filename.length - 5);
  28. window.location.replace("index.html#" + imagename);
  29. --></script>
  30. <style type="text/css">
  31. #prevbutton1 { border-color: #000000 #FFFFFF #000000 #000000 }
  32. #prevbutton2 { border-color: #FFFFFF #000000 #FFFFFF #000000 }
  33. #nextbutton1 { border-color: #FFFFFF #000000 #FFFFFF #000000 }
  34. #nextbutton2 { border-color: #000000 #000000 #000000 #FFFFFF }
  35. #playbutton1 { border-color: #000000 #000000 #000000 #FFFFFF }
  36. #playbutton2 { border-color: #FFFFFF }
  37. #pausebutton1 { border-color: #FFFFFF }
  38. #playbutton1 { border-color: ]] )write( model.nonCSS.playbutton1borderColor )write( [[ }
  39. #playbutton2 { border-color: ]] )write( model.nonCSS.playbutton2borderColor )write( [[ }
  40. #nextbutton1 { border-color: ]] )write( model.nonCSS.nextbutton1borderColor )write( [[ }
  41. #nextbutton2 { border-color: ]] )write( model.nonCSS.nextbutton2borderColor )write( [[ }
  42. #prevbutton1 { border-color: ]] )write( model.nonCSS.prevbutton1borderColor )write( [[ }
  43. #prevbutton2 { border-color: ]] )write( model.nonCSS.prevbutton2borderColor )write( [[ }
  44. #pausebutton1 { border-color: ]] )write( model.nonCSS.pausebuttonBorderColor )write( [[ }
  45. </style>
  46. <!--]] .. "[" .. [[if lt IE 7]] .. "]" .. [[>
  47. ]] ) if mode ~= 'preview' then write( [[
  48. <link href="]] )write( theRoot )write( [[/pngfix.css" media="screen" rel="stylesheet" type="text/css" />
  49. ]] ) end write( [[
  50. <!]] .. "[" .. [[endif]] .. "]" .. [[-->
  51. </head>
  52. <body>
  53. ]] )
  54. local loadingdots='<div class="loading">'
  55. local n
  56. for n = 1, model.nonCSS.loadingdots.number do
  57. loadingdots = loadingdots .. "<span>·</span>"
  58. end
  59. loadingdots = loadingdots .. "</div>"
  60. write( [[
  61. <div id="beltcontainer">
  62. <div id="belt">
  63. ]] )
  64. if model.nonCSS.fittingType == "width" then
  65. fitClass = "fithorizontal"
  66. elseif model.nonCSS.fittingType == "height" then
  67. fitClass = "fitvertical"
  68. else
  69. -- We scale based on the orientation of the photo.
  70. --
  71. -- To do that we need to find a resolution that was actually exported...
  72. image = getImage(index)
  73. if model.nonCSS.images_large.export then
  74. width = image.renditions.large.width
  75. height = image.renditions.large.height
  76. elseif model.nonCSS.images_medium.export then
  77. width = image.renditions.medium.width
  78. height = image.renditions.medium.height
  79. else
  80. width = image.renditions.small.width
  81. height = image.renditions.small.height
  82. end
  83. if width > height then
  84. fitClass = "fithorizontal"
  85. else
  86. fitClass = "fitvertical"
  87. end
  88. end
  89. write( [[
  90. <div class="beltobjectwrapper ]] )write( fitClass )write( [["><div class="beltobjectcenterer"><div class="beltobject"><img src="]] )write( folder .. "/" .. image.exportFilename )write( [[.jpg"></div></div></div>
  91. </div>
  92. </div>
  93. ]] ) if model.nonCSS.displayIdentityPlate then
  94. if #model.nonCSS.identityPlateLink > 0 then write( [[
  95. <div id="logo"><a href="]] )write( model.nonCSS.identityPlateLink )write( [["><img src="]] )write( theRoot )write( [[/resources/logo.png" alt=""></a></div>
  96. ]] ) else write( [[
  97. <div id="logo"><img src="]] )write( theRoot )write( [[/resources/logo.png"></div>
  98. ]] ) end write( [[
  99. ]] ) end write( [[
  100. <div id="menu">
  101. <table cellspacing="0" cellpadding="0" border="0">
  102. <tr>
  103. <td class="menubarpadding"></td>
  104. <td id="menuitems">
  105. <ul>
  106. ]] ) if model.nonCSS.menuitems.one.included then write( [[<li><a href="]] )write( model.nonCSS.menuitems.one.url )write( [[">]] )write( model.nonCSS.menuitems.one.title )write( [[</a></li>]] ) end write( [[
  107. ]] ) if model.nonCSS.menuitems.two.included then write( [[<li><a href="]] )write( model.nonCSS.menuitems.two.url )write( [[">]] )write( model.nonCSS.menuitems.two.title )write( [[</a></li>]] ) end write( [[
  108. ]] ) if model.nonCSS.menuitems.three.included then write( [[<li><a href="]] )write( model.nonCSS.menuitems.three.url )write( [[">]] )write( model.nonCSS.menuitems.three.title )write( [[</a></li>]] ) end write( [[
  109. ]] ) if model.nonCSS.menuitems.four.included then write( [[<li><a href="]] )write( model.nonCSS.menuitems.four.url )write( [[">]] )write( model.nonCSS.menuitems.four.title )write( [[</a></li>]] ) end write( [[
  110. ]] ) if model.nonCSS.menuitems.five.included then write( [[<li><a href="]] )write( model.nonCSS.menuitems.five.url )write( [[">]] )write( model.nonCSS.menuitems.five.title )write( [[</a></li>]] ) end write( [[
  111. </ul>
  112. </td>
  113. ]] ) if model.nonCSS.controlsEnabled then write( [[
  114. ]] ) do local LrPaginationEntries = {}
  115. local oldWrite = write
  116. write = function( w )
  117. table.insert( LrPaginationEntries, function() oldWrite( w ) end )
  118. end
  119. write( [[
  120. ]] )LrPaginationEntries.PreviousEnabled = function( page, link ) write( [[
  121. <td class="control">
  122. <div class="controlContainer" id="prevbutton">
  123. <table cellspacing="0" cellpadding="0" border="0" align="center"><tr><td class="controlbit"><a href="]] )write( link )write( [[" id="prevbutton1" class="slant"><!-- --></a></td><td class="controlbit"><a href="]] )write( link )write( [[" id="prevbutton2" class="slant"><!-- --></a></td></tr></table>
  124. </div>
  125. </td>
  126. <td class="control"></td>
  127. ]] )end table.insert( LrPaginationEntries, 'Previous' ) write( [[
  128. ]] )LrPaginationEntries.NextEnabled = function( page, link ) write( [[
  129. <td class="control">
  130. <div class="controlContainer" id="nextbutton">
  131. <table cellspacing="0" cellpadding="0" border="0" align="center"><tr><td class="controlbit"><a href="]] )write( link )write( [[" id="nextbutton1"class="slant"><!-- --></a></td><td class="controlbit"><a href="]] )write( link )write( [[" id="nextbutton2" class="slant"><!-- --></a></td></tr></table>
  132. </div>
  133. </td>
  134. <td class="menubarpadding"></td>
  135. ]] )end table.insert( LrPaginationEntries, 'Next' ) write( [[
  136. ]] )write = oldWrite LrTagFuncs.PaginationFunc( _G, LrPaginationEntries ) end write( [[
  137. ]] ) end write( [[
  138. </tr>
  139. </table>
  140. </div>
  141. ]] ) if model.nonCSS.dots.enabled then write( [[
  142. <div id="dotswrapper">
  143. <div id="dots">]] ) for d = 1, numImages do write( [[<a ]] ) if d == index then write('class="selected"') end write( [[ ]] ) if d == 1 then write('class="first"') end write( [[ href="]] )write( getImage(d).exportFilename )write( [[.html">]] ) if model.nonCSS.dots.type == "squares" then write("" .. d) else write ('·') end write( [[</a>]] ) end write( [[</div>
  144. </div>
  145. ]] ) end write( [[
  146. <div id="pr1"><img src="resources/blank.gif"></div>
  147. <div id="pr2"></div>
  148. ]] ) --[[ Include the page footer]] write( [[
  149. </body>
  150. </html>
  151. ]] )