Uploading file problem

Status
Not open for further replies.

HyDr@

New Member
Messages
268
Reaction score
0
Points
0
File (HyDrA-Art_KarimB_16342.jpg) uploaded!
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file in /home/hydra/public_html/hydraportfolio5/thumb.php on line 32

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/hydra/public_html/hydraportfolio5/thumb.php on line 32

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'work/wallpaper/HyDrA-Art_KarimB_16342.jpg' is not a valid JPEG file in /home/hydra/public_html/hydraportfolio5/thumb.php on line 32

Warning: Division by zero in /home/hydra/public_html/hydraportfolio5/thumb.php on line 35

Warning: Division by zero in /home/hydra/public_html/hydraportfolio5/thumb.php on line 36

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /home/hydra/public_html/hydraportfolio5/thumb.php on line 38

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/hydra/public_html/hydraportfolio5/thumb.php on line 41

Warning: imagecolorallocate(): supplied argument is not a valid Image resource in /home/hydra/public_html/hydraportfolio5/thumb.php on line 46

Warning: imageline(): supplied argument is not a valid Image resource in /home/hydra/public_html/hydraportfolio5/thumb.php on line 47

Warning: imageline(): supplied argument is not a valid Image resource in /home/hydra/public_html/hydraportfolio5/thumb.php on line 48

Warning: imageline(): supplied argument is not a valid Image resource in /home/hydra/public_html/hydraportfolio5/thumb.php on line 49

Warning: imageline(): supplied argument is not a valid Image resource in /home/hydra/public_html/hydraportfolio5/thumb.php on line 50

Warning: imagepng(): supplied argument is not a valid Image resource in /home/hydra/public_html/hydraportfolio5/thumb.php on line 51

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/hydra/public_html/hydraportfolio5/thumb.php on line 52

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/hydra/public_html/hydraportfolio5/thumb.php on line 53


Dont see whats the problem, tried uploading the same image to my old host which contain all the same scripts, its fine with the other host, so I guess its the server problem or something... :dunno:

Everything is perfectly fine except I can't upload images to the server through php.

I think the problem is it cant create a thumbnail of the img Im uploading, something must be messed up with the library.
 
Last edited:

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
HyDr@ said:
Dont see whats the problem, tried uploading the same image to my old host which contain all the same scripts, its fine with the other host, so I guess its the server problem or something with the library... :dunno:

Everything is perfectly fine except I can't upload images to the server through php.

I think its saying the file is not a jpg...if you renamded the extention PHP wont beable to process it.
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
By looking at this error:
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file in /home/hydra/public_html/hydraportfolio5/thumb.php on line 32

I can tell that it is somethign wrong with the image file after it is uploaded, "Premature end of JPEG file." Thus the image functions are not able to manipulate the image, since it's not "valid."

If you can/want to, post the script and I can take a look at it for you. :)
 
Last edited:

HyDr@

New Member
Messages
268
Reaction score
0
Points
0
im pretty sure it is, it does upload it on my other hosting, also I tried different jpg img, and all failed, lemme check the CHMOD, that MIGHT be the problem.


to Bryon, k, wait a sec.................................

also, have you seen my pm I sent you, i need some help, i can send the pm again.

EDIT: nope, nothing to do with CHMOD :< also it doesnt work with ALL the jpeg files I upload... ^_^


this is my script, its a bit rubbish, i never touched the library thing before.



PHP:
<?php

$fileparts = explode(".", $filename);
if ($fileparts[1]==jpg)
{$filetype="jpeg";}
else
if ($fileparts[1]==gif)
{$filetype="gif";}
else
if ($fileparts[1]==png)
{$filetype="png";}
$imagecreatefrom='imagecreatefrom'.$filetype;
$src_img = $imagecreatefrom("work/$categories/$filename");
$src_size = getimagesize("work/$categories/$filename");
$ratio=$src_size[0]/150;
$dest_x = $src_size[0] / $ratio;
$dest_y = $src_size[1] / $ratio;
$dst_img = imagecreatetruecolor
($dest_x, $dest_y);
imagecopyresampled($dst_img, $src_img, 0, 0, 0,
0, $dest_x, $dest_y, $src_size[0], 
$src_size[1]);


$widthm1 = $dest_x - 1;
$heightm1 = $dest_y - 1;
$color = imagecolorallocate($dst_img, 161, 171, 181);
imageline( $dst_img, 0,0, $widthm1, 0, $color);
imageline( $dst_img, $widthm1, 0, $widthm1, $heightm1, $color);
imageline( $dst_img, $widthm1, $heightm1, 0, $heightm1, $color);
imageline( $dst_img, 0, $heightm1, 0, 0, $color);
imagepng($dst_img, "work/$categories/small_$filename");
imagedestroy($src_img);
imagedestroy($dst_img);
$resolution="$src_size[0]"."x"."$src_size[1]";
mysql_query("UPDATE `work` SET `resolution` = '$resolution' WHERE `filename` = '$filename'");
?>

By the way, the script DID work for x10hosting a while back, didn't know when it started to cock up, its been like a month since I uploaded any wallpapers xD
 
Last edited:

HyDr@

New Member
Messages
268
Reaction score
0
Points
0
Problem solved, im pretty sure it was some kind of server problem, because it suddenly started working again :biggrin:
 
Status
Not open for further replies.
Top