0

Within Modx Revolution, I'm trying to get phpthumb to work from within a snippet I'm writing - I think I have almost all the pieces, but I've a hunch that maybe I'm not formatting the image filepath correctly.

This is the code I have:

$input = "http://www.domain.com/assets/files/".$cover;
$width = 610;
$height = 504;
$options = "w=$width&h=$height&zc=1";  
$thumb = $modx->runSnippet("phpthumbof",array('input' => $input, 'options' => $options));

If I comment out the last line, the page loads without errors, but uncommented I get an error and nothing else:

The image “http://www.domain.com/” cannot be displayed because it contains errors.

But if I echo the value of $input, it does give the image URL, so I assume that phpthumb doesn't want a URI string...?

What am I doing wrong?

verism
  • 1,106
  • 1
  • 12
  • 35
  • Did you try to change `$input = "http://www.domain.com/assets/files/".$cover;` to `$input = "assets/files/".$cover;` or input file placed on another domen? – Vasis Apr 08 '14 at 12:37
  • Thanks for the reply. The input file is on the same domain. I tried your suggestion - there are no errors this time, but it still doesn't output a filepath. – verism Apr 08 '14 at 13:38
  • https://github.com/modxcms/phpthumbof/ - phpThumbOf is official depriciatated. Use pthumb or phpthumbsup instead. – Vasis Apr 08 '14 at 20:09
  • I wasn't aware; thanks. I received a solution, on the ModX forum, to my initial problem. – verism Apr 08 '14 at 20:37

0 Answers0