I'm trying to do crop animated gif on VDS with this configuration:
~800MHz and 256 RAM
And it's not working. It just eats memory and processor and after a ~minute returns no responce.
http://i192.photobucket.com/albums/z228/Somebi/no-responce.jpg
On local machine i'v created a virtual machine with 256 RAM. Everything works fine, but a bit slow i must admit... But i have Duo Core 7400 on local machine.
I have tried to limit memory usage on VDS with these settings:
$gif = new Imagick($s['src']);
set_time_limit(0);
$gif->setResourceLimit(Imagick::RESOURCETYPE_MEMORY,32);
$gif->setResourceLimit(Imagick::RESOURCETYPE_MAP,64);
// echo $gif->getResourceLimit(Imagick::RESOURCETYPE_MEMORY);
// echo $gif->getResourceLimit(Imagick::RESOURCETYPE_MAP);
// echo $gif->getResourceLimit(Imagick::RESOURCETYPE_FILE);
// echo $gif->getResourceLimit(Imagick::RESOURCETYPE_DISK);
// echo $gif->getResourceLimit(Imagick::RESOURCETYPE_AREA);
// exit;
$gif = $gif->coalesceImages();
foreach($gif as $frame){
$frame->cropImage($s['params']['w'], $s['params']['h'], $s['params']['x'], $s['params']['y']);
$frame->setImagePage($s['params']['w'], $s['params']['h'], 0, 0);
}
$gif->writeImages($s['dest_path'] .'/'. $fullname,true);
But can i limit processor usage?
And is there any solution for slow VDS? :|
Thanks everyone!
update:
print_r(getimagesize($s['src']));
exit;
$gif = new Imagick($s['src']);
etc...
Array
(
[0] => 530
[1] => 150
[2] => 1
[3] => width="530" height="150"
[bits] => 8
[channels] => 3
[mime] => image/gif
)
update2:
pathinfo($s['src'])
(
[dirname] => images/tmp
[basename] => 43138a0723d6ae0799564bd6acb8c7b83c8df483.gif
[extension] => gif
[filename] => 43138a0723d6ae0799564bd6acb8c7b83c8df483
)
update3: How to debug imagick extension? :(
Have found this package: http://fr2.rpmfind.net/linux/RPM/fedora/updates/testing/13/i386/debug/php-pecl-imagick-debuginfo-3.0.0-5.fc13.i686.html
Have anyone tried it?