|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-10-14 05:58 UTC] Galchonok dot Galka at GMail dot com
Description:
------------
The script should cut one image 10 times and finish the job.
But the script prematurely exits (1-2 sec), without waiting 30 seconds.
If you add the set_time_limit (0), then the script will work allotted task (perezhmёt 10 images).
Test script:
---------------
try
{
$name = time() . "-$i.gif";
$name = $PATH . '/test_img/' . $name;
$CImagick = new Imagick($PATH . '/1.gif');
$format = $CImagick->getImageFormat();
if(isset($animation_formats[$format]))
{
$images = $CImagick->coalesceImages();
do
{
$images->resizeImage($w, $h, Imagick::FILTER_LANCZOS, 0.9);
} while ( $images->nextImage() );
$images->deconstructImages();
$images->writeImages($name, true);
}
else
{
$CImagick->resizeImage($w, $h, Imagick::FILTER_LANCZOS, 0.9);
$CImagick->writeImage($name);
}
$CImagick->clear();
$CImagick->destroy();
echo $i . "<br>" . PHP_EOL;
}
catch( Exception $e)
{
exit($e->getMessage());
}
full test: http://j2.ru/test.txt
Expected result:
----------------
Start
0
1
2
3
4
5
6
7
8
9
end
Actual result:
--------------
Start
Fatal error: Maximum execution time of 30 seconds exceeded in /home/j2/public_html/test.php on line 30
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Hi all. 1) I am use ImageMagick version 3.1.2. 2) error is reproduced through apache or CLI. 3) The program is interrupted anywhere Maximum execution time of 30 sekonds. Enabled error output to the screen. Error reproduced on Linux CentOS 6.5 and Fedora 20. Partially solved the problem by setting the team putenv: ("MAGICK_THREAD_LIMIT = 1") and set_time_limit(0). Sorry for my lousy English :)