473,224 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

proportional resize with maximum height and maximum width.

hello,
is it possible to resize an image with same proportion.
having a maximum height and a maximum width.

the solution should work on main browsers (do not use max-height and
max-width).

or should i do it with javascript?

Nov 3 '07 #1
3 8830
In article
<11*********************@o3g2000hsb.googlegroups.c om>,
Jean-Sébastien <je***************@gmail.comwrote:
is it possible to resize an image with same proportion.
having a maximum height and a maximum width.
The question as a whole makes no sense.

If you want an image to resize with a container and be in some
proportion, then you can size the container in % terms and also
the image in css to be 100% wide and high inside that container.

--
dorayme
Nov 3 '07 #2
On 2007-11-03, dorayme <do************@optusnet.com.auwrote:
In article
<11*********************@o3g2000hsb.googlegroups. com>,
Jean-Sébastien <je***************@gmail.comwrote:
>is it possible to resize an image with same proportion.
having a maximum height and a maximum width.

The question as a whole makes no sense.
Well you could read it as requiring all three things: allow any resize
operation that doesn't exceed max height, that also doesn't exceed max
width, and that also preserves aspect ratio.

I don't think that's exactly what the spec gives you unfortunately. It
tries to keep aspect ratio as close as possible to the intrinsic aspect
ratio subject to the min/max constraints. But it doesn't treat aspect
ratio itself as a constraint, so you can end up hitting max-width and
max-height with the wrong aspect ratio.

OP should study the table at

http://www.w3.org/TR/CSS21/visudet.html#min-max-widths
Nov 3 '07 #3
Jean-Sébastien wrote:
>
is it possible to resize an image with same proportion.
having a maximum height and a maximum width.
Not with just CSS. You can't confine the dimensions independently of
each other and not have it skew.
or should i do it with javascript?
Depends on what you're doing with these images. If it's something like a
photo gallery, it might be better to do it server side with something
like ImageMagick.

--
Berg
Nov 3 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ragnorack67 | last post by:
Hi, I am looking for a complete PHP function that will resize & optimize any JPG image with very good end results. My server is running PHP 4.3.8. So, for instance a 1600x1200 JPG at...
6
by: David Hayes | last post by:
juglesh <juglesh@nospamRadioKDUG.com> wrote in "Re: how to maximize the browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12 AM): > > >I want to maximize the browser...
2
by: DraguVaso | last post by:
Hi, I have to DataGrid's on a form, one on the top of my form, the other at the bottom, but they though each other somewhere in the middle. What I want now is that, when I resize the form, they...
3
by: john andrew | last post by:
-- hello How do you start a form maximized in VB.net So that the form width and height properties are also set at screen maximum. Just setting the form to maximise doesnt change the...
6
by: Rob | last post by:
I need to create a form that will resize only the verticle size of the Form and not the width. So far I'm partial to the following code. Can someone please elaborate the ??? . . . . Const...
15
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
6
by: evolozik | last post by:
hi everyone i need some help please i am using PHP5 and i used a tutorial and when i copied the code for Resampling an image proportionally, it worked perfectly but when i added it in my page it...
4
by: Rob | last post by:
I want to resize the height of a form without resizing the width, therefore I tried: Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize ...
7
by: mishrarajesh44 | last post by:
hii all Truly telling i hav got this code from net & i am finding error while running the code below.. code:- <?php $idir = "photo/"; // Path To Images Directory $tdir =...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.