I try to convert a rgb color to transparent
When i use this code in the command line, it works perfect.
convert -transparent 'RGB(249,249,255)' /home/me/web/my.png /home/me/web/mynew.png
But when i use it with php:
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
$output = shell_exec("convert -transparent 'RGB(249,249,255)' /home/me/web/my.png /home/me/web/mynew.png");
?>
i get the error:
convert: unable to open image `/home/me/web/mynew.png’: @ error/blob.c/OpenBlob/2498.
Has anyone a idea?
To me that looks like an access-rights issue. Your web server tries to write a file inside your home directory.
Normally your home-directory is protected in such a way that no one except yourself can write files in there. Therefore your web server can not create the new file while you can when using the terminal.
Check the access rights to the folder that shall contain the new image and allow the user that is running the web server to write to that folder.