Jump to content
php.lv forumi

Attēla upload warningi


senters

Recommended Posts

Uz mana localhosta pēc attēla pievienošanas tiek izmesti šādi paziņojmi: Paziņojumi

 

Uz servera "x" viss strādā lieliski, nekādu wārningu nav. Kur varētu būt problēma, kas nav pareizi nokonfigurēts?

 

php.ini failā aktīvi ir šādi moduļi:

 

extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
extension=php_mysql.dll
extension=php_mysqli.dll

Edited by senters
Link to comment
Share on other sites

function make_thumb3($src, $dest, $desired_width, $desired_height)

{

$source_image = imagecreatefromjpeg($src); (229. rinda)

$width = imagesx($source_image);

$height = imagesy($source_image);

$newwidth = $desired_width;

$newheight = ($height / $width) * $newwidth;

if ($width < $desired_width) { $newwidth = $width; } else { $newwidth = $desired_width; }

if ($height < $desired_height) { $newheight = $height; } else { $newheight = ($height / $width) * $newwidth; }

$tmp = imagecreatetruecolor($newwidth, $newheight);

imagecopyresized($tmp, $source_image, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

imagejpeg($tmp, $dest);

}

Edited by senters
Link to comment
Share on other sites

Izdarīju šādi:

 

function make_thumb3($src, $dest, $desired_width, $desired_height)

{

$src = $_FILES['att']['tmp_name'];

$source_image = imagecreatefromjpeg($src);

$width = imagesx($source_image);

$height = imagesy($source_image);

$newwidth = $desired_width;

$newheight = ($height / $width) * $newwidth;

if ($width < $desired_width) { $newwidth = $width; } else { $newwidth = $desired_width; }

if ($height < $desired_height) { $newheight = $height; } else { $newheight = ($height / $width) * $newwidth; }

 

221. $tmp = imagecreatetruecolor($newwidth, $newheight);

222. imagecopyresized($tmp, $source_image, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

223. imagejpeg($tmp, $dest);

}

un tagad palika tikai 3 paziņojumi:

 

Paziņojumi 2

Edited by senters
Link to comment
Share on other sites

Funkcijas izsaukums:

$image_name3=$uid.'-'.time().'1'.'.'.$extension; 
$newname3="../Images/Events/Large/".$image_name3; 
$copied3 = copy($_FILES['att']['tmp_name'], $newname3); 
make_thumb3(500, 0, $newname3, $newname3);

Edited by senters
Link to comment
Share on other sites

Tu funkcijai padod nepareizus mainīgos.

 

make_thumb3(ATTĒLS(fails), JAUNAIS RESIZE ATTĒLS(fails), PLATUMS(pikseļi, veseli skaitļi), AUGSTUMS(pikseļi, veseli skaitļi));

 

Pareizi būtu -

make_tumb3($copied3, $newname3, 500, 0);

Edited by webi
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...