Witam serdecznie,
Znalazłem na stronie: https://code.tutsplus.com/tutorials/create-...-php--net-24504

Fajny skrypt do nakładania filtrów na obrazki (instagramowe):
  1. //phpinfo();
  2.  
  3. class Instagraph
  4. {
  5.  
  6. public $_image = NULL;
  7. public $_output = NULL;
  8. public $_prefix = 'IMG';
  9. private $_width = NULL;
  10. private $_height = NULL;
  11. private $_tmp = NULL;
  12.  
  13. public static function factory($image, $output)
  14. {
  15. return new Instagraph($image, $output);
  16. }
  17.  
  18. public function __construct($image, $output)
  19. {
  20. if(file_exists($image))
  21. {
  22. $this->_image = $image;
  23. list($this->_width, $this->_height) = getimagesize($image);
  24. $this->_output = $output;
  25. }
  26. else
  27. {
  28. throw new Exception('File not found. Aborting.');
  29. }
  30. }
  31.  
  32. public function tempfile()
  33. {
  34. # copy original file and assign temporary name
  35. $this->_tmp = $this->_prefix.rand();
  36. copy($this->_image, $this->_tmp);
  37. }
  38.  
  39. public function output()
  40. {
  41. # rename working temporary file to output filename
  42. rename($this->_tmp, $this->_output);
  43. }
  44.  
  45. public function execute($command)
  46. {
  47. # remove newlines and convert single quotes to double to prevent errors
  48. $command = str_replace(array("\n", "'"), array('', '"'), $command);
  49. $command = escapeshellcmd($command);
  50. # execute convert program
  51. exec($command);
  52. }
  53.  
  54. /** ACTIONS */
  55.  
  56. public function colortone($input, $color, $level, $type = 0)
  57. {
  58. $args[0] = $level;
  59. $args[1] = 100 - $level;
  60. $negate = $type == 0? '-negate': '';
  61.  
  62. $this->execute("convert
  63. {$input}
  64. ( -clone 0 -fill '$color' -colorize 100% )
  65. ( -clone 0 -colorspace gray $negate )
  66. -compose blend -define compose:args=$args[0],$args[1] -composite
  67. {$input}");
  68. }
  69.  
  70. public function border($input, $color = 'black', $width = 20)
  71. {
  72. $this->execute("convert $input -bordercolor $color -border {$width}x{$width} $input");
  73. }
  74.  
  75. public function frame($input, $frame)
  76. {
  77. $this->execute("convert $input ( '$frame' -resize {$this->_width}x{$this->_height}! -unsharp 1.5×1.0+1.5+0.02 ) -flatten $input");
  78. }
  79.  
  80. public function vignette($input, $color_1 = 'none', $color_2 = 'black', $crop_factor = 1.5)
  81. {
  82. $crop_x = floor($this->_width * $crop_factor);
  83. $crop_y = floor($this->_height * $crop_factor);
  84.  
  85. $this->execute("convert
  86. ( {$input} )
  87. ( -size {$crop_x}x{$crop_y}
  88. radial-gradient:$color_1-$color_2
  89. -gravity center -crop {$this->_width}x{$this->_height}+0+0 +repage )
  90. -compose multiply -flatten
  91. {$input}");
  92. }
  93.  
  94. /** RESERVED FOR FILTER METHODS */
  95.  
  96. }
  97.  
  98.  
  99.  
  100. try
  101. {
  102. $instagraph = Instagraph::factory('input.jpg', 'output.jpg');
  103. }
  104. catch (Exception $e)
  105. {
  106. echo $e->getMessage();
  107. die;
  108. }
  109.  
  110. // loop through all filters
  111.  
  112. foreach(array('gotham', 'toaster', 'nashville', 'lomo', 'kelvin') as $method)
  113. {
  114. $instagraph->_output = $method.'.jpg'; // we have to change output file to prevent overwrite
  115. $instagraph->$method(); // apply current filter (from array)
  116. }
  117.  


Na serwerze mam zainstalowane zarówno GD jak i ImageMagick.

Po uruchomieniu skryptu na ekranie nic się nie dzieje (mam biały ekran) - bez błędów itp.
Zdjęcia także się nie generują sad.gif Wie ktoś może dlaczego tak się dzieje?