senters Posted October 12, 2010 Report Share Posted October 12, 2010 (edited) 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 October 12, 2010 by senters Link to comment Share on other sites More sharing options...
Леший Posted October 12, 2010 Report Share Posted October 12, 2010 Pirmo kļūdu skaties, pārējās pazūdīs, kad izlabosi pirmo. Ja nevari pārtulkot, tad tur ir rakstīts, ka nav atrasts fails. Link to comment Share on other sites More sharing options...
senters Posted October 12, 2010 Author Report Share Posted October 12, 2010 (edited) 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 October 12, 2010 by senters Link to comment Share on other sites More sharing options...
Леший Posted October 12, 2010 Report Share Posted October 12, 2010 Ka lai to paskaidro... Redz, šī funkcija nevar strādāt, ja fails $src nav atrasts. Protams, neapgalvoju, ka man ir taisnībā, bet tomēr neliela varbūtība ir, ka problēma ir ar failu, kura nosaukums ir iekš $src. Link to comment Share on other sites More sharing options...
senters Posted October 12, 2010 Author Report Share Posted October 12, 2010 (edited) 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 October 12, 2010 by senters Link to comment Share on other sites More sharing options...
marcis Posted October 12, 2010 Report Share Posted October 12, 2010 Aizej līdz kādai grāmatnīcai un nopērc angļu - latviešu vārdnīcu. Parādi kā tu to funkciju izsauc, kādus parametrus padod. Link to comment Share on other sites More sharing options...
senters Posted October 12, 2010 Author Report Share Posted October 12, 2010 (edited) 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 October 12, 2010 by senters Link to comment Share on other sites More sharing options...
webi Posted October 12, 2010 Report Share Posted October 12, 2010 (edited) 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 October 12, 2010 by webi Link to comment Share on other sites More sharing options...
senters Posted October 12, 2010 Author Report Share Posted October 12, 2010 Tiešām, milzīgs paldies Tev webi Link to comment Share on other sites More sharing options...
Recommended Posts