Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > PHP
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help.

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 07-01-2007, 4:13 PM   #1
Spoofed Existence
 
Spoofed Existence's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Strange problem: IE Loads forever

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





 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 07-01-2007, 4:13 PM   #2
Spoofed Existence
 
Spoofed Existence's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Strange problem: IE Loads forever

amazing how some things in internet explorer work again when you close all
ineternet explorer windows!

Problem somehow fixed

"Spoofed Existence" <spoofedexistence@hotmail.com> schreef in bericht
news:3f2cd089$0$147$1b62eedf@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
>
>
>
>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags: , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
strange image problem - how does this work? Mark HTML 5 07-01-2007 1:46 PM
Halo 2 down loads is it true John 112 via XboxJunkies.com Console Subjects 3 06-26-2007 2:06 PM
Strange Connection Problem Nate R. Console Subjects 3 06-26-2007 3:08 AM
Xbox Live: Strange Connection Problem ...plz help Daisy Console Subjects 0 06-26-2007 1:32 AM
MDB2 ibase Reverse: strange case problem Alessandro Pasotti Pear 3 05-20-2007 6:34 PM


Featured Websites




All times are GMT +1. The time now is 12:23 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98