I use Imagine in a Silex environment,
In a main objective to create thumbnails from PDF files, I choose the romainneutron/Imagine-Silex-Service-Provider to do this kind of PHP ImageMagick conversion.
Everything is OK when I use the Imagick driver and when I open a pdf file without parameter :
bootstrap.php :
$app->register(new ImagineServiceProvider(), array('imagine.driver' => 'Imagick'));
aController.php :
$path = "/path/to/file/";
$filename = "aFileame";
$image = $app['imagine']->open(dirname(dirname(__DIR__)).$path.$filename.".pdf")
->resize(new Box(160, 240))
->save(dirname(dirname(__DIR__)).$path."/thumb/".$fileName."_thumb@2x.png")
->resize(new Box(80, 120))
->save(dirname(dirname(__DIR__)).$path."/thumb/".$filename."_thumb.png");
But if I I try to just open the first page of the document ( .pdf[0] ) :
$image = $app['imagine']->open(dirname(dirname(__DIR__)).$path.$filename.".pdf[0]")
I have got an exception :
InvalidArgumentException in AbstractImagine.php line 67:
File /path/to/file/aFileame[0] does not exist.
Thanks for the help.
Julien