public static function extractPDFArea($file, $page, $rect, $to = null, $options = array(), $cache = null)
{
- $final = Files::mkdir($cache) . Poppler::extractAreaFilehash($file, $page, $rect, $options) . '.' . $options['format'];
+ $ext = $options['format'];
+ if ($ext === 'jpeg') {
+ $ext = 'jpg';
+ }
+
+ $final = Files::mkdir($cache) . Poppler::extractAreaFilehash($file, $page, $rect, $options) . '.' . $ext;
+
if (file_exists($final)) {
return $final;
}
['operation' => 'extractpdfarea',
'pdf' => $file,
'out' => $cache,
- 'page' => json_encode($rect),
- 'area' => $rect,
+ 'page' => $page,
+ 'area' => json_encode($rect),
'options' => json_encode($options)], 0, false, true);
});
}