Border Effects, Vintage 2, Sketch, tilt shift - fail on 6.9

A plethora of command-line scripts that perform geometric transforms, blurs, sharpens, edging, noise removal, and color manipulations.
Post Reply
audas
Posts: 5
Joined: 2016-01-27T02:27:24-07:00
Authentication code: 1151

Border Effects, Vintage 2, Sketch, tilt shift - fail on 6.9

Post by audas » 2016-01-27T02:52:37-07:00

Hi,
I was noticing that the torn effect on vintage2 was not working , nor is the border, when I was using it on a CentOS server - I then noticed that tilt shift was having issues as well.

I isolated the simple sketch effect out with the correct direct paths, and used the vignette to ensure these paths were all correct - I discovered that -sketch is simply not working.

So tilt shift creates a black image, Vintage2 torn effect causes the entire script to fail,Vintage2 shadow does not work, Border Effects has some strange results where the Y axis is exaggerated, background texture has the same problem where there the effect is vertical but not horizontal, (lines up and down instead of a nice dispersed effect), sketch simply does not work at all.

The package installed on the server is the most latest, however it is the most basic package as well. There is a BC Math installed.

I noticed that these functions tend to come under the transform or fx areas ?

I have been running these on my local windows machine under xampp with imagemagick 6.9 absolutely no problem - it is only when I load them to the server.


Some details about the install

I am hoping that someone might be able to hammer down what I have not installed, what needs to be installed or where things are going wrong.

Thanks in advance

Code: Select all

PHP INFO

imagick

imagick module	enabled
imagick module version	3.3.0
imagick classes	Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
Imagick compiled with ImageMagick version	ImageMagick 6.9.0-10 Q16 x86_64 2016-01-22 http://www.imagemagick.org
Imagick using ImageMagick library version	ImageMagick 6.9.0-10 Q16 x86_64 2016-01-22 http://www.imagemagick.org
ImageMagick copyright	Copyright (C) 1999-2015 ImageMagick Studio LLC
ImageMagick release date	2016-01-22
ImageMagick number of supported formats:	22




------------------------------------------/usr/local/bin

            ffmpeg*        lwp-rget*                 phar.phar*       sa-compile*
../             ffprobe*       Magick-config*            php*             sa-learn*
a2p*            ffserver*      Magick++-config*          php-config*      sa-update*
animate*        find2perl*     MagickCore-config*        phpize*          shasum*
bdf2gdfont.pl*  findrule*      MagickWand-config*        piconv*          spamassassin*
c2ph*           gpgmailtunl*   mal-scan*                 pl2pm*           spamc*
chartex*        graph-easy*    mech-dump*                pod2html*        spamd*
compare*        h2ph*          mencoder*                 pod2latex*       spfd*
composite*      h2xs*          mogrify*                  pod2man*         spfquery*
config_data*    htmltree*      montage*                  pod2text*        splain*
conjure*        identify*      mplayer*                  pod2usage*       srs*
convert*        imgsize*       neroAacEnc*               podchecker*      srsd*
corelist*       import*        oscartest*                podselect*       stream*
cpan*           instmodsh*     package-stash-conflicts*  prove*           stty.pl*
cpandb*         ip2cc*         pear*                     psed*            tpage*
cpan-mirrors*   ipcount*       peardev*                  pstruct*         ttree*
crc32*          iptab*         pecl*                     ptar*            vsyasm*
dbilogstrip*    json_pp*       perl*                     ptardiff*        Wand-config*
dbiprof*        lame*          perl5.8.8*                ptargrep*        wp*
dbiproxy*       libnetcfg*     perlbug*                  pwhich*          x264*
display*        lwp-download*  perlcc*                   qt-faststart*    xsubpp*
dprofpp*        lwp-dump*      perldoc*                  s2p*             yasm*
enc2xs*         lwp-mirror*    perlivp*                  sa-awl*          ytasm*
faac*           lwp-request*   phar@                     sa-check_spamd*  zipdetails*
root@vps15452 [/usr/local/bin]#

User avatar
fmw42
Posts: 22101
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Border Effects, Vintage 2, Sketch, tilt shift - fail on 6.9

Post by fmw42 » 2016-01-27T11:12:22-07:00

I am confused. My scripts do not run under Imagick. They are bash unix shell scripts the use Imagemagick and do not run on vanilla Windows. Are you using PHP exec() to run them?

What was your exact commands that fail (using exact argument values and not argument variables so I can test). Are you sure you have bc? Did you set up the scripts and server according to my Pointers on my home page (at the link below)? What error messages are you getting? Do you have the vintage background image?

What is the full list of scripts that you have tested that fail?

Did you test with my example images or your own? If the latter, have you tried my examples?

Is it possible that your are not pointing my scripts to the correct location for the Imagemagick you have installed with Imagick and it is finding a very old version of Imagemagick.

What do you get from running

Code: Select all

type -a convert
or

Code: Select all

which -a convert
It would appear that it is your server environment and not my scripts that are failing.

audas
Posts: 5
Joined: 2016-01-27T02:27:24-07:00
Authentication code: 1151

Re: Border Effects, Vintage 2, Sketch, tilt shift - fail on 6.9

Post by audas » 2016-01-28T04:30:14-07:00

Hi thanks for getting back to me on this.

First up I want to apologise for seeming to infer that it was your scripts which had errors in them. That was a sloppy title but I was pushed for space. All of the scripts I am having trouble with I tested on my local windows machine where they worked, but only SOME failed on the CentoOS.

Secondly I want to thank you for creating these scripts - I spent many years creating these types of scripts with C++ and complex algorithms in Flash only to have them rendered useless.

My prognosis so far is that :

EDIT BC Calculator is installed I ran the following SSH command bc -v which returned bc 1.06.95
  • I am thinking it is either BC Calculator is not installed.

    Scripts which create a copy in tmp directory are failing, (I have CHMOD these to 777 along with scripts I am testing)

    or that I have an incomplete isntallation of imagemagick.
I have also noticed that -sketch appears to come under Transformations and FX - this could be the issue if it is a limited isntallation of imagemagick.

I have tested and run all your scripts on windows and they all worked except for isolate colour which I could not get to work. Everything else I tested I was able to get working. (Did not test them all - but probably around 20) - I have no problems running them under windows. Yes I was running them as bash scripts following your instructions.

My primary issue is that WITHOUT using your scripts and simply using -sketch I can not get the imagemagick to run the command and was hoping for some pointers as to why. (Imagemagick appears to be running fine on most other commands I have tried).

AS far as your scripts are concerned the failures on CentOS were that texturize did not look right, torn borders also looks different, vintage does not have a thick black border, remap colours does not work, toycamera does not work with POSITIVE lens distortion, but negative does (although this may be something I have done wrong - there is a variation between windows and UNIX in that some variables require quotes, while others do not).


The BC MATH I have seen is the PHP BC MATH presented below, however I understand that it is an UNIX thing and this may not be correct.

I am also thinking that it may be a BC calculator issue as the other scripts which are showing errors are Bordereffects (vertical impact but no horizonal, y axis not x), texturize(again y axis but not x) and Vintage2 (Vintage2 is only failing to display the large external border, and fails completely when TORN is selected).

But the thing which pushes me to this conclusion the most is that Isolate color failed on my local windows tests - AND and the CentOS tests.


Code: Select all

PHP INFO - Configuration

bcmath

BCMath support	enabled
Is there an SSH (putty) command I can run on my server to see if BC calculator is running ?

I have not included the vintage background image, however I am not including it in any of my tests.

I am not sure how to extract the error messages when scripts fail. They fail silently. I have tried including a secondary array to print out in the exec command however no error is delivered.

I have not tested with your images on the live server - I will try and do this. However I have tried with many images (PNG and JPG) and they worked on my local system but not on the live CentOS server. And the same image is working with all of your other scripts.

I ran type -a convert and tested -sketch with the derived locations as per your instructions.

I too would agree that it is the server environment - absolutely - and am hoping to find out why. I personally believe it is the BC calculator issue OR the minimum installation of imagemagick which they performed on 6.9.3-Q16, or a tmp file issue.


Sorry for the long winded response - want to get as much info across to you as possible. Thanks for taking the time on this. And I totally understand that this is not your problem and most likely a server issue, so understand if you pass over this.

Kind regards

Audas.

User avatar
fmw42
Posts: 22101
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Border Effects, Vintage 2, Sketch, tilt shift - fail on 6.9

Post by fmw42 » 2016-01-28T10:53:41-07:00

I am still confused. Are you running the scripts under PHP exec()?

PHP bcmath is not the same as unix bc calculator. Some of my scripts require the unix command bc.

The IM function -sketch is not the same as my sketch script.

I fixed a couple of typos in isolatecolor. It now seems to work for me. So download again and see if it now works on your Windows system.

Assuming you are using PHP exec, then lets try some simple things.

1) I am not sure where your IM is installed. Lets check.

<?php
echo "<pre>";
system("type -a convert");
echo "</pre>";
?>

typical places

<?php
exec("/usr/local/bin/convert -version",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>

<?php
exec("/usr/bin/convert -version",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>



2) Does this return 10.000000?

<?php
exec("echo 'scale=6; 5*2/1' | bc",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>



3) Do both of these work? change path2/ to the full path to where you have my scripts

<?php
exec("bash path2/2colorthresh logo: logo.gif 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>

<?php
exec("path2/2colorthresh logo: logo.gif 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>


4) Do these work

<?php
exec("bash path2/aspectcrop -a 1:1 logo: logo.gif 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>

<?php
exec("path2/aspectcrop -a 1:1 logo: logo.gif 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>


5) Does this work and produce the following image? Note that it seems that I have some of the image arguments swapped or recorded wrong on some of my example images. Also unless you use the -r reseed, results will be random.

<?php
exec("bash path2/bordereffects -s 5 -d 1 -c 5 -p 2 -r 100 hatching.jpg hatching_be.jpg 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>

<?php
exec("path2/bordereffects -s 5 -d 1 -c 5 -p 2 -r 100 hatching.jpg hatching_be.jpg 2>&1",$out,$returnval);
foreach($out as $text)
{echo "$text<br>";}
?>

Image

Image

audas
Posts: 5
Joined: 2016-01-27T02:27:24-07:00
Authentication code: 1151

Re: Border Effects, Vintage 2, Sketch, tilt shift - fail on 6.9

Post by audas » 2016-01-28T23:00:43-07:00

Hi,
sorry for all of this again, and thanks for your patience. Seems like my trials were poorly conducted. To answer your questions.

Yes I am using php exec()

I have UNIX calculator installed.

isolated color is now working on windows and live (thanks).


As for my ongoing issue - it was indeed TWO INSTALLATIONS of imagemagick. I had requested my hosts update it and they updated it to BOTH 6.90 and 6.9.3, so -sketch (standard imagemagick sketch) is now working.

As for your scripts updating the correct path has fixed MOST SCRIPTS. However the Vintage2 script still does not work on my remote server. I am at a loss. It works in all manner except the large round thick border. I do not have the vintage background for it as I do not use it.

Also REMAP does not work.

What I did notice is that you take the $dir variable and then use it to create a secondary directory, will look further into permissions but am at a loss.

Thanks for your time and effort on this, particularly in reworking isolate color as it is a powerful effect.

Speak soon.

Audas.

User avatar
fmw42
Posts: 22101
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Border Effects, Vintage 2, Sketch, tilt shift - fail on 6.9

Post by fmw42 » 2016-01-29T00:05:48-07:00

I will look at Vintage2 and remap, tomorrow. Too tired to do any good tonight. Perhaps something in Imagemagick has changed that is affecting the scripts. Do they provide any error messages?

Post Reply