'Using ImageMagick with Cronjob Commandline paths
I have the following code to update a graphical map with ImageMagick commandline. It works fine when run directly from the website, but I am attempting to schedule it via a cronjob. It doesn't appear to be finding the images in the $m string that I build - I think due to a path issue? The full server path used in if (file_exists(...))
works, but I have tried the actual ImageMagick commend line with both full server path and local path and doesn't seem to work. Any ideas what Im doing wrong here?
$icon_on_map_fullpath = "/home/site/public_html/media/icon_on_map/";
$icon_on_map_path = "../media/icon_on_map/";
foreach($map_clusters as $mc) {
$icon_name = $mc['cluster_id'].'.png';
if (file_exists($icon_on_map_fullpath.$icon_name)) {
$m .= $icon_on_map_path.$icon_name." -geometry +".$mc['clus_x']."+".$mc['clus_y']." -composite ";
}
}
exec("convert master_map.png {$m} lastest_map.png ");
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|