JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old June 10th, 2005, 12:50 PM
Mirabell Mirabell is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Location: Croatia
Posts: 1 Mirabell User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 42 sec
Reputation Power: 0
img size problems

Hallo programers!
I have a problem with displaying images. I have an aplication where user can upload pictures, but very little place for displaying them. So, this is what I need:
Function that compare width and height of image and then, resize it like that: maximum width is 350px and maximum height is 110px . If picture is bigger, it is resized in the way that doesn't lose proportions if not, nothing happends.
Can anybody help me?
It should be java script, aplication is written in asp.

Reply With Quote
  #2  
Old June 10th, 2005, 12:54 PM
Cirus Cirus is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 272 Cirus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 11 h 16 m 3 sec
Reputation Power: 4
Do you need the code or logic?

Reply With Quote
  #3  
Old June 10th, 2005, 12:55 PM
ezenaide's Avatar
ezenaide ezenaide is offline
custom user
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: olinda - br
Posts: 77 ezenaide User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 12 h 44 m 50 sec
Reputation Power: 4
Send a message via MSN to ezenaide
Quote:
Originally Posted by Mirabell
It should be java script, aplication is written in asp.


maybe you should put this in the javascript forum

Reply With Quote
  #4  
Old June 11th, 2005, 04:25 AM
infamous-online infamous-online is offline
Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 404 infamous-online User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 24 m 44 sec
Reputation Power: 7
hey i moved this thread into where it will warrant more responses.
__________________
Apache Expert

Reply With Quote
  #5  
Old June 12th, 2005, 09:59 AM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: I have emerged from the place of spells and fairies
Posts: 97 ChiefWigs1982 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 17 h 35 m 12 sec
Reputation Power: 4
Javascript can't get the actual dimensions of the image, only the
dimensions you give the browser. Not only that, there is no way to
guarantee that the client has JavaScript enabled or even installed
on their machine; so I would suggest you do this on the server with
asp/php or whatever -> Get the dimensions, do some checking, and
create the html dynamically accordingly.

/My tuppence...

Reply With Quote
  #6  
Old June 13th, 2005, 08:12 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
I was going to question the use of Javascript, but I see that Agent47 already has.
Definately has to be done server-side... perhaps on-upload...

Alternatively, have a fixed width and simply hardcode the IMG dimensions in the HTML.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > img size problems


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway