Page 1 of 1

Bug with adding texture to image

Posted: 2007-08-29T06:26:54-07:00
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.

Re: Bug with adding texture to image

Posted: 2007-08-29T09:30:42-07:00
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

Re: Bug with adding texture to image

Posted: 2007-08-29T10:36:28-07:00
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.

Re: Bug with adding texture to image

Posted: 2007-08-29T13:11:17-07:00
by zygomatic
Server specs: CentOS, ImageMagick 6.3.5, PHP 5.0.4

Re: Bug with adding texture to image

Posted: 2007-08-30T06:30:22-07:00
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/

Re: Bug with adding texture to image

Posted: 2007-09-03T04:41:16-07:00
by zygomatic
Bump: anyone ideas how to move around this bug??

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

Re: Bug with adding texture to image

Posted: 2007-09-05T01:58:23-07:00
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??

Re: Bug with adding texture to image

Posted: 2007-09-28T03:58:20-07:00
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.