You are here: imagecreatefromjpeg() uses too much memory « All PHP « IT news, forums, messages
imagecreatefromjpeg() uses too much memory

Posted by kapten on 09/28/70 11:43

Hi!

I'm making a function for uploading and resizing images to my web
hotel.
Problem is, memory_limit is set to 16M so when uploading larger images
the script crashes.

So, I tried to override the memory_limit setting, but as it turns out,
my web host has set some safe mode setting,
so that no settings can be changed in the php.ini, and they wont change
the setting to a higher value themselves.

This is were the code crashes:

$image_p = imagecreatetruecolor($widthNew, $heightNew);

if($mime=="image/jpeg" || $mime=="image/pjpeg") {

$image = imagecreatefromjpeg($imgarray["tmp_name"]);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $widthNew,
$heightNew, $widthOrg, $heightOrg);

imagejpeg($image_p, $save_dir.$temp_filename, 80);
return "Done";

}

The line $image = imagecreatefromjpeg($imgarray["tmp_name"]); causes
the problem.

Do any of you know any other way to solve this problem?

--
Thanks
Fredrik

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация