filesize - PHP image resizing not working. Is there a file size limit? -


i'm using simple image manager class, , following code:

<?php include('simpleimage.php'); $image = new simpleimage(); $image->load($target_path); if($image->getwidth() > 500) {     $image->resizetowidth(500);     echo "<p>image resized</p>"; } else echo "<p>image did not need resized.</p>"; $image->save($target_path); echo "<p>image saved</p>"; ?> 

the image resized when upload image width of 700, when upload big picture (width ~= 2300), doesn't work, , don't see of echo messages.

do php image functions have size limit might causing this?

you hitting memory_limit setting specified in php.ini.

add error_reporting(e_all); script , see output is.

use phpinfo() find out current memory limit setting.

it can changed using ini_set("memory_limit", xyz). otherwise, need change php.ini.

a 2300 x 2300 pixel image going take @ least

2300 x 2300 x 3 = 15,870,000 

= 16 megabytes of ram (or 2300 x 2300 x 4 if there's alpha channel) i'd need @ least 24 megabytes of ram per script make work well. maybe more.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -