Resized Images show as a line in Internet Explorer

Posted on 2008-11-10
Last Modified: 2013-12-25
I resize picture in my html.  They displayed fine prior to resizing.  Now theyare still fine in FF, Safari but in IE they show as a line.  Website is  click on JR Costruction image and view images on subsequent page.

Below is the code where I resize the image
$imagesize = getimagesize ($descriptpict1, &$info);

if ($imagesize[0] > 0){

$newheight = 260 / $imagesize[0] * $imagesize[1]; 

$newwidth = 260;}

if ($descriptpict1 != NULL AND $descriptpict1 != ' ') {?>

<img src = "<?php echo $descriptpict1;?>" width ="<?php echo $newwidth;?>" height="<?php $newheight;?>">

Open in new window

Question by:tpiccirillo
    LVL 14

    Expert Comment

    Hi tpiccirillo,

    Your "$newheight" variable is coming up null or something. The source code being outputed is this:

    <img src = "" width ="260" height="">

    Firefox and other Gecko based browsers are ignoring the lack of a height value, but IE is treating » height="" « as "0". Fix you PHP for that and it should be OK.

    You might have to debug and find out what values the "$imagesize[0]" and "$imagesize[1]" are giving.

    Hope this helps.

    LVL 107

    Accepted Solution

    Try putting the "echo" statement into this thing:

    height="<?php $newheight;?>">

    See if that helps,


    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
    The viewer will learn how to dynamically set the form action using jQuery.
    Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now