By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,553 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

Image size

P: n/a
I am having a problem with this code. The problem I am facing is that
the first image is displayed in its original size. But when I click the
next button, the next image not displayed in its original size, but
being displayed as 100 x 100 pixels, same goes to the 3rd picture and so
on. How do I solve the problem.
<%Option Explicit%>
<!--#INCLUDE FILE="inc_Common.asp" -->
<%
On Error Resume Next

Folder = Request("Folder")
FileNbr = Request("imgNbr")
ImageFilePath = myFolder + "/" + Request("Folder")
counter = 0
lImgCounter = 0

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Server.MapPath(ImageFilePath))

For Each objFile In objFolder.Files
strFileExtension = LCase(Mid(objFile.Name, InStrRev(objFile.Name, ".",
-1, 1) + 1))

If strFileExtension = "gif" Or strFileExtension = "jpg" Then
If (CLng(counter) = CLng(FileNbr)) then
imgCurrentBaseName = objFSO.GetBaseName(objFile.Name)
lImgCounter = lImgCounter + 1

ShowImageLink = "<img src=""" & myFolder & "/" & Folder & "/" &
objFile.Name & """ vspace=""15"" hspace=""15"" border=""0""" & """>"
CurrentFileName = objFSO.GetBaseName(objFile.Name)
FileNameSpaces = Replace(CurrentFileName,"_"," ")

End If
counter = counter + 1
End If
Next
%>
<html>
<head>
<title>Full Image</title>
</head>

<body bgcolor="#000000">
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="*"
align="center">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%"
align="center">
<tr>
<td class="header" align="left" width="10"><img
src="icons/td_top_left.gif" width="8" height="20" border="0"></td>
<td class="header" align="left" width="*"><font
class="PopTitle"><%= FileNameSpaces %></font></td>
<td class="header" align="right" width="80" valign="center">
</td>
<td class="header" align="right" width="10"><img
src="icons/td_top_right.gif" width="8" height="20" border="0"></td>
</tr>
</table>
<table cellpadding="2" cellspacing="0" border="0" width="100%">
<tr>
<td align="center">
<%
Response.Write ShowImageLink
ThumbNextLink = CLng(FileNbr) + 1
ThumbPreviousLink = CLng(FileNbr) - 1
%>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%"
align="center">
<tr>
<td class="middle" align="left" width="10"><img
src="icons/td_bot_left.gif" width="8" height="20" border="0"></td>
<% If (CLng(FileNbr)) > 0 Then %>
<td class="middle" align="left" width="80">
<A href="show.asp?Folder=<%= Folder %>&imgNbr=<%=
ThumbPreviousLink %>" class="links">Previous</A>
</td>
<% End If %>
<td class="middle" align="center" width="*">&nbsp;</td>
<% If (CLng(FileNbr) < (CLng(counter)) - 1) Then %>
<td class="middle" align="right" width="55">
<A href="show.asp?Folder=<%= Folder %>&imgNbr=<%= ThumbNextLink
%>" class="links">Next</A>
</td>
<% End If %>
<td class="middle" align="right" width="10"><img
src="icons/td_bot_right.gif" width="8" height="20" border="0"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
Set objFSO = Nothing
Set objFolder = Nothing
%>

Eugene Anthony

*** Sent via Developersdex http://www.developersdex.com ***
Jun 9 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

Eugene Anthony wrote:
I am having a problem with this code.


Is the folder code working properly now? Only I just spent some time
trying to go through your code to reply to the other thread, then found
this one? Was I wasting my time?

--
Mike Brind

Jun 9 '06 #2

P: n/a
You have not wasted your time. Now the folder problem works fine. This
question is different. Its related to image size.

Eugene Anthony

*** Sent via Developersdex http://www.developersdex.com ***
Jun 10 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.