SproutCMS

This is the code documentation for the SproutCMS project

function imagemagick()

Convert file using ImageMagick

Usage

string FileConvert::imagemagick ( string $in_file , string $out_ext [, int $page_index [, int $density ]] );

Arguments

  1. string $in_file
    Input filename, with full path
  2. string $out_ext
    Extension to convert file to, e.g. "png", "jpg".
  3. int $page_index = 0
    Page number of document, 0-based (applies to PDFs and other page-based documents)
  4. int $density = 400
    DPI

Exceptions thrown

  • Exception
    Conversion failure
  • InvalidArgumentException
    The $out_ext argument has an invalid format
  • RuntimeException
    ImageMagick isn't installed/accessible to PHP
  • FileConversionException
    ImageMagick failed to convert the file

Return value

  • string
    Destination file in temp dir