HighDots Forums  

Image Resize Problem

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Image Resize Problem in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tsindos
 
Posts: n/a

Default Image Resize Problem - 12-13-2005 , 12:56 PM






In order to avoid creating multiple images on the server, I am scaling images
to fit a certain width using HTML (width=???). This is perfect for me because
if the user submits a large image I control the display. (a little longer
download time but still OK) But if the user uploads a small image, I do not
want it resized - example: http://www.cyads.com.cy/Electronics/item.asp?ID=18.
I know this can be done with just a little asp but I have tried so many
if...then...else which didn't work so I thought I should ask for help.
My current code is attached.
I am not a very well-versed asp programmer (self taught on the Internet) so
whenever I tried to put an <%if..then%> statement replacing the width = "300"
everything got distorted. At some point I made it but had a blue border line
and in trying to remove it I lost everything.

Any help is greatly appreciated.

Thank you.


<%Dim PicShow1
PicShow1 = tNG_showDynamicImage("../", "../ProdPhotos/",
"{rsItemElectronics.Photo1}")
IF PicShow1 = "../includes/tng/styles/img_not_found.gif" then %>
<div align="center"><font size="2" face="Arial, Helvetica,
sans-serif"><%response.Write(" ")%></font></div>
<%else%>
<a href="<%=tNG_showDynamicImage("../", "../ProdPhotos/",
"{rsItemElectronics.Photo1}")%>" onclick="return popImage(this.href,'Product
Info');">
<img src="<%=PicShow1%>" alt="Sold by
<%=(rsItemElectronics.Fields.Item("SellerName").Va lue)%>" </a>width = "300"
border="0"></a>
<%End If%>


Reply With Quote
  #2  
Old   
E Michael Brandt
 
Posts: n/a

Default Re: Image Resize Problem - 12-13-2005 , 03:30 PM






I offer a free Server Behavior called "Image Bounds" (never updated it
beyond DW4, but will soon). You can take a look at its code however and
see how it handles this.

http://valleywebdesigns.com/vwd_Vdw.asp

emichael


tsindos wrote:
Quote:
In order to avoid creating multiple images on the server, I am scaling images
to fit a certain width using HTML (width=???). This is perfect for me because
if the user submits a large image I control the display. (a little longer
download time but still OK) But if the user uploads a small image, I do not
want it resized - example: http://www.cyads.com.cy/Electronics/item.asp?ID=18.
I know this can be done with just a little asp but I have tried so many
if...then...else which didn't work so I thought I should ask for help.
My current code is attached.
I am not a very well-versed asp programmer (self taught on the Internet) so
whenever I tried to put an <%if..then%> statement replacing the width = "300"
everything got distorted. At some point I made it but had a blue border line
and in trying to remove it I lost everything.

Any help is greatly appreciated.

Thank you.


%Dim PicShow1
PicShow1 = tNG_showDynamicImage("../", "../ProdPhotos/",
"{rsItemElectronics.Photo1}")
IF PicShow1 = "../includes/tng/styles/img_not_found.gif" then %
div align="center"><font size="2" face="Arial, Helvetica,
sans-serif"><%response.Write(" ")%></font></div
%else%
a href="<%=tNG_showDynamicImage("../", "../ProdPhotos/",
"{rsItemElectronics.Photo1}")%>" onclick="return popImage(this.href,'Product
Info');"
img src="<%=PicShow1%>" alt="Sold by
%=(rsItemElectronics.Fields.Item("SellerName").Val ue)%>" </a>width = "300"
border="0"></a
%End If%


Reply With Quote
  #3  
Old   
tsindos
 
Posts: n/a

Default Re: Image Resize Problem - 12-13-2005 , 11:49 PM



Thank you for your reply.
Although it seems "Image Bounds" will save me many headaches, I cannot use any
Server Behaviours because I have no access to the server. It must only be
client side scripting.
Also, it seems that all I need is a simple ASP code.
Thank you again.
Harry


Reply With Quote
  #4  
Old   
Lionstone
 
Posts: n/a

Default Re: Image Resize Problem - 12-14-2005 , 02:19 PM



If you're using ASP, you are using server-side scripting and can use server
behaviors.

"tsindos" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Thank you for your reply.
Although it seems "Image Bounds" will save me many headaches, I cannot use
any
Server Behaviours because I have no access to the server. It must only be
client side scripting.
Also, it seems that all I need is a simple ASP code.
Thank you again.
Harry




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.