Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8396685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:36:09+00:00 2026-06-09T20:36:09+00:00

I was wondering if it is possible to do some kind of function which

  • 0

I was wondering if it is possible to do some kind of function which will get the height of a constrained width image? I can get the original height by using:

list($width, $height, $type, $attr) = getimagesize($path."/images/".$image->image);

But my images on the page are constrained to be 580px wide:

<img src="/images/<?php echo $image->image; ?>" width="580" height="????" border="0" />

I was wondering if it were at all possible to get the new height of the constrained width image?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:36:11+00:00Added an answer on June 9, 2026 at 8:36 pm

    Its all about ratios. You already have the ratio of the width/height for the original. Now you just need to get it in terms of your 580px width. width/height is to 580/X

    function getHeight($width,$height){ //originals 
        return (580*$height)/$width;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is some kind of academic question, I just wondering if it is possible
i was wondering if it is possible to generate some kind of template that
Reading some posts from Jimmy Boggard and wondering - how exactly is it possible
Just wondering is it possible to build CLI app that can be run from
I was wondering if it is even possible to interact with other websites using
I am wondering if this is possible and maybe some code examples if it
I'm looking for some kind of a resource (website) that would list all possible
This is purely an experiment, but I'm wondering if it's possible to get a
I'm trying to create some kind of a server which allows me to start
I was wondering if it was possible to determine from which column a coalesce

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.