By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

Strange Problem: IE Loads forever

P: n/a
Ok, I have a very weird problem here. I want to use .php to create
thumbnails. For this, I use the following code:
<?
$file = isset($_GET['file']) ? $_GET['file'] : exit;

//Load the image
$src = imagecreatefromjpeg($file);
if($src)
{
$width = ImageSx($src);
$height = ImageSy($src);
$maxwidth = 140;
$maxheight = $maxwidth / 1.333333;
if($width > $height / 1.333333)
{
$newwidth = $maxwidth;
$newheight = $height / ($width / $newwidth);
} else {
$newheight = $maxheight;
$newwidth = $width / ($height / $newheight);
}

$dest = ImageCreate($newwidth, $newheight);
ImageCopyResized($dest, $src, 0, 0, 0, 0, $newwidth, $newheight, $width,
$height);

header("Content-Type: image/jpg");
Imagejpeg($dest);
exit;
}
?>

This file is called showthumb.php. Now in my C:\inetpub\wwwroot\ directory
(Yes, im doing this all under windows) I create a file called test.html
(after having some trouble, but this will explain the problem). I put the
following data in this test.html:
<img src=http://localhost/showthumb.php?file=pic.jpg>
(where pic.jpg was a valid .jpg file inside the C:\inetpub\wwwroot\
directory)
I opened this file in internet explorer by going to
C:\inetpub\wwwroot\test.html. It worked, the image got displayed (although
the colors where screwed up, but that i might be able to fix that myself). I
went to http://localhost/test.html (Thus the same .html file) and it did not
display the image! It just kept loading without actually doing anything. I
tried the same in Mozilla Firebird... Not a single problem. both
C:\inetpub\wwwroot\test.html and http://localhost/test.html showed the
picture as expected.

Now: What's wrong? How can I fix this crap?

Thanks

Jul 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
amazing how some things in internet explorer work again when you close all
ineternet explorer windows!

Problem somehow fixed :S

"Spoofed Existence" <sp**************@hotmail.com> schreef in bericht
news:3f*********************@news.wanadoo.nl...
Ok, I have a very weird problem here. I want to use .php to create
thumbnails. For this, I use the following code:
<?
$file = isset($_GET['file']) ? $_GET['file'] : exit;

//Load the image
$src = imagecreatefromjpeg($file);
if($src)
{
$width = ImageSx($src);
$height = ImageSy($src);
$maxwidth = 140;
$maxheight = $maxwidth / 1.333333;
if($width > $height / 1.333333)
{
$newwidth = $maxwidth;
$newheight = $height / ($width / $newwidth);
} else {
$newheight = $maxheight;
$newwidth = $width / ($height / $newheight);
}

$dest = ImageCreate($newwidth, $newheight);
ImageCopyResized($dest, $src, 0, 0, 0, 0, $newwidth, $newheight, $width,
$height);

header("Content-Type: image/jpg");
Imagejpeg($dest);
exit;
}
?>

This file is called showthumb.php. Now in my C:\inetpub\wwwroot\ directory
(Yes, im doing this all under windows) I create a file called test.html
(after having some trouble, but this will explain the problem). I put the
following data in this test.html:
<img src=http://localhost/showthumb.php?file=pic.jpg>
(where pic.jpg was a valid .jpg file inside the C:\inetpub\wwwroot\
directory)
I opened this file in internet explorer by going to
C:\inetpub\wwwroot\test.html. It worked, the image got displayed (although
the colors where screwed up, but that i might be able to fix that myself). I went to http://localhost/test.html (Thus the same .html file) and it did not display the image! It just kept loading without actually doing anything. I
tried the same in Mozilla Firebird... Not a single problem. both
C:\inetpub\wwwroot\test.html and http://localhost/test.html showed the
picture as expected.

Now: What's wrong? How can I fix this crap?

Thanks


Jul 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.