Pentiums Posted December 15, 2008 Report Share Posted December 15, 2008 Problēma ielādējot palielu bildi, lai to samazinātu thumbnailā Fatal error: Allowed memory size of 13631488 bytes exhausted (tried to allocate 29996 bytes) in neteikšu PHP konfigurācijā ir memory_limit = 128M NETICU ka ar 128mb nepietiek lai samazinātu 700x1000px bildīti...... P.S uzliekot ar iniset fiju 12mb uzreiz tie 29996 baiti pamazinaajaas uz ~7000 bet iniset neļāva pielikt vairāk par 12mb :( kur varētu būt nolāpītā problēma? Link to comment Share on other sites More sharing options...
Ghenis Posted December 15, 2008 Report Share Posted December 15, 2008 Scripts neiet bezgalīgajā ciklā ? Iepostē vainīgo kodu + rindiņu . Link to comment Share on other sites More sharing options...
Delfins Posted December 15, 2008 Report Share Posted December 15, 2008 gļukains jpeg? jeb pa vidu kaut ko dari un neatbrīvo? Link to comment Share on other sites More sharing options...
Pentiums Posted December 15, 2008 Author Report Share Posted December 15, 2008 uz php_ini() parāda ka memory limits ir uzlikts tik cik ar ini_set noraadu kautvai 128MB vai 256 utt.. bet tur blakus ir master_value un tas staav 12mb, kā lai izmaina master value? mož tas kko šakarē? function foto_mazizmers($filetype, $origfile, $thumbfile, $new_w, $new_h) { global $settings; if ($filetype == "image/gif" || $filetype == "image/x-gif") { $origimage = imagecreatefromgif($origfile); } elseif ($filetype == "image/jpeg" || $filetype == "image/pjpeg") { $origimage = imagecreatefromjpeg($origfile); } elseif ($filetype == "image/png" || $filetype == "image/x-png") { $origimage = imagecreatefrompng($origfile); } $old_x = imagesx($origimage); $old_y = imagesy($origimage); if ($old_x > $new_w || $old_y > $new_h) { if ($old_x < $old_y) { $thumb_w = round(($old_x * $new_h) / $old_y); $thumb_h = $new_h; } elseif ($old_x > $old_y) { $thumb_w = $new_w; $thumb_h = round(($old_y * $new_w) / $old_x); } else { $thumb_w = $new_w; $thumb_h = $new_h; } } else { $thumb_w = $old_x; $thumb_h = $old_y; } if ($settings['thumb_compression'] == "gd1") { $thumbimage = imagecreate($thumb_w,$thumb_h); $result = imagecopyresized($thumbimage, $origimage, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y); } else { $thumbimage = imagecreatetruecolor($thumb_w,$thumb_h); $result = imagecopyresampled($thumbimage, $origimage, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y); } touch($thumbfile); if ($filetype == "image/gif" || $filetype == "image/x-gif") { imagegif($thumbimage, $thumbfile); } elseif ($filetype == "image/jpeg" || $filetype == "image/pjpeg") { imagejpeg($thumbimage, $thumbfile); } elseif ($filetype == "image/png" || $filetype == "image/x-png") { imagepng($thumbimage, $thumbfile); } } RINDIŅA: elseif ($filetype == "image/jpeg" || $filetype == "image/pjpeg") { $origimage = imagecreatefromjpeg($origfile); }[code]funkcija laba, lietoju jau sen, uzliekot uz cita servera uzreiz kakas spļauj ārā ar saviem memory_**** Link to comment Share on other sites More sharing options...
Pentiums Posted December 15, 2008 Author Report Share Posted December 15, 2008 nu labi to master value es tikko dabuju uz 128M iekš PHP5.INI bet tikuntā nekas nemainās Link to comment Share on other sites More sharing options...
Pentiums Posted December 15, 2008 Author Report Share Posted December 15, 2008 nu nezinu kas tur bija tajā fjā, bet atradu citu kas man strādā mož kādam noderēs http://www.white-hat-web-design.co.uk/arti...ge-resizing.php Link to comment Share on other sites More sharing options...
Delfins Posted December 15, 2008 Report Share Posted December 15, 2008 ka tik tas nebija gd-bags. Ar tām imagecreate atceros bija visādi pigori - pat ja padosi nekorketu failu tā uzreiz krešo. Link to comment Share on other sites More sharing options...
Pentiums Posted December 15, 2008 Author Report Share Posted December 15, 2008 mhhhh hmmm.. fails itkā korekts, testēju ar windows sample pictures (ar taam ainavaam) padodot failu ar otru fju ko atradu, tur viss normāli :) Link to comment Share on other sites More sharing options...
p4F Posted December 27, 2008 Report Share Posted December 27, 2008 man arī bija tāda problēma, vaina bija ka thumb un īstais izmērs seivojas vienā un tajā pašā foldērā ar vienu un to pāšu nosaukumu, un nebija chmod uzlikts. Link to comment Share on other sites More sharing options...
Recommended Posts