Bug with adding texture to image

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
zygomatic

Bug with adding texture to image

Post by zygomatic »

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.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Bug with adding texture to image

Post by el_supremo »

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
zygomatic

Re: Bug with adding texture to image

Post by zygomatic »

It is also working on the server of our developer, but not on our hosting server.

Will post specs of hosting server later.
zygomatic

Re: Bug with adding texture to image

Post by zygomatic »

Server specs: CentOS, ImageMagick 6.3.5, PHP 5.0.4
zygomatic

Re: Bug with adding texture to image

Post by zygomatic »

It is working on Windows XP with Apache server, PHP5.1 and Imagemagick 6.3.5

Test it on: http://www.rasaint.net/fotoaanpassen/
zygomatic

Re: Bug with adding texture to image

Post by zygomatic »

Bump: anyone ideas how to move around this bug??

I have upgraded CentOs, but that didn't solve it unfortunately.
zygomatic

Re: Bug with adding texture to image

Post by zygomatic »

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.

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;
}
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:

Code: Select all

if($_REQUEST['act']=='Pencil')
{
exec('convert '.$_REQUEST["imageFileName"].' -colorspace gray -sketch 0x20+120 '.$imagesurse.'');
echo $imagesurse;
}
Does somebody have a solution for this??
zygomatic

Re: Bug with adding texture to image

Post by zygomatic »

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.
Post Reply