For a Dutch site (http://www.fotoaanpassen.nl) I want to add texture to an image (go to SpecialFX and then add texture).
Texture is http://www.fotoaanpassen.nl/images/texture_fabric.gif
I am using the method on http://www.imagemagick.org/Usage/photos/#texture
exec('composite images/texture_fabric.gif '.$_REQUEST["imageFileName"].' -tile -compose Hardlight '.$imagesurse.'');
The result is not what I expected, try it yourself on fotoaanpassen.nl (SpecialFX -> Add Texture)
Version of ImageMagick is 6.3.5. If I choose any other existing gif for the texture, the result is the same.
All other image manipulations are working, just this one does not work.
Bug with adding texture to image
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: Bug with adding texture to image
I tried that on the command line with version 6.3.5 and get the correct image.
composite texture_fabric.gif lime.jpg -tile -compose Hardlight lime_texture.jpg
Pete
composite texture_fabric.gif lime.jpg -tile -compose Hardlight lime_texture.jpg
Pete
Re: Bug with adding texture to image
It is also working on the server of our developer, but not on our hosting server.
Will post specs of hosting server later.
Will post specs of hosting server later.
Re: Bug with adding texture to image
Server specs: CentOS, ImageMagick 6.3.5, PHP 5.0.4
Re: Bug with adding texture to image
It is working on Windows XP with Apache server, PHP5.1 and Imagemagick 6.3.5
Test it on: http://www.rasaint.net/fotoaanpassen/
Test it on: http://www.rasaint.net/fotoaanpassen/
Re: Bug with adding texture to image
Bump: anyone ideas how to move around this bug??
I have upgraded CentOs, but that didn't solve it unfortunately.
I have upgraded CentOs, but that didn't solve it unfortunately.
Re: Bug with adding texture to image
Update:
Command works perfectly on commandline, but somehow it does not work when I call it via exec with PHP. I even tried giving the right paths to the images, see below 2 codes that do not work.
All other commands that I use (all converts) do work fine in this way. So I probably am doing something wrong, but do not have a clue what it is.
example of a convert that works fine:
Does somebody have a solution for this??
Command works perfectly on commandline, but somehow it does not work when I call it via exec with PHP. I even tried giving the right paths to the images, see below 2 codes that do not work.
Code: Select all
if($_REQUEST['act']=='Texture')
{
exec('composite images/texture_fabric.jpg '.$_REQUEST["imageFileName"].' -tile -compose Hardlight '.$imagesurse.'');
echo $imagesurse;
}
Code: Select all
if($_REQUEST['act']=='Texture')
{
exec('composite '.$_SERVER['DOCUMENT_ROOT'].'/images/texture_fabric.gif '.$_SERVER['DOCUMENT_ROOT'].'/'.$_REQUEST["imageFileName"].' -tile -compose Hardlight '.$_SERVER['DOCUMENT_ROOT'].'/'.$imagesurse);
echo $imagesurse;
}
example of a convert that works fine:
Code: Select all
if($_REQUEST['act']=='Pencil')
{
exec('convert '.$_REQUEST["imageFileName"].' -colorspace gray -sketch 0x20+120 '.$imagesurse.'');
echo $imagesurse;
}
Re: Bug with adding texture to image
We found the solution.
We had 2 versions of Imagemagick installed. The commandline used the latest version, but somehow the PHP exec command did use an old installation. Deleting the old installation solved the problem.
We had 2 versions of Imagemagick installed. The commandline used the latest version, but somehow the PHP exec command did use an old installation. Deleting the old installation solved the problem.