I'm trying to use the imagemagick command "convert" to create a .tif image from a .png one.
What I've come with is:
$exec = "/opt/local/bin/convert -adaptive-resize 150% ".$pos.".png ".$pos.".tif";
exec($exec);
If I run into CLI "which convert" I get that path: /opt/local/bin/convert
. I've also tried without the path, only /opt/local/bin/convert -adaptive-resize 150% ".$pos.".png ".$pos.".tif
and /etc/local/bin/convert -adaptive-resize 150% ".$pos.".png ".$pos.".tif
.
If I'm running that command into the terminal it works as expected but when I'm trying to use it from the PHP script it doesn't work.
EDIT: I've also tried without success to create a .sh file with the following code:
#! /bin/bash
convert -adaptive-resize 150% 1.png 1.tif
convert -adaptive-resize 150% 2.png 2.tif
convert -adaptive-resize 150% 3.png 3.tif
convert -adaptive-resize 150% 4.png 4.tif
convert -adaptive-resize 150% 5.png 5.tif
convert -adaptive-resize 150% 6.png 6.tif
convert -adaptive-resize 150% 7.png 7.tif
convert -adaptive-resize 150% 8.png 8.tif
convert -adaptive-resize 150% 9.png 9.tif
If I run it from terminal it works like a charm. Instead if I try to execute it from a simple PHP file it doesn't create any .tif file.
<?php
$exec = "./convertpngtif.sh";
exec($exec);
?>