diff --git a/lib/Alchemy/Phrasea/Border/Manager.php b/lib/Alchemy/Phrasea/Border/Manager.php index aeaa1a3f7e..69dbe88a4b 100644 --- a/lib/Alchemy/Phrasea/Border/Manager.php +++ b/lib/Alchemy/Phrasea/Border/Manager.php @@ -442,10 +442,7 @@ class Manager $spec->setDimensions(375, 275); try { - $this->app['media-alchemyst'] - ->open($file->getFile()->getPathname()) - ->turnInto($lazaretPathnameThumb, $spec) - ->close(); + $this->app['media-alchemyst']->turnInto($file->getFile()->getPathname(), $lazaretPathnameThumb, $spec); } catch (MediaAlchemystException $e) { } diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Publications.php b/lib/Alchemy/Phrasea/Controller/Admin/Publications.php index 769143246f..240c232409 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Publications.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Publications.php @@ -141,10 +141,7 @@ class Publications implements ControllerProviderInterface $tmpname = tempnam(sys_get_temp_dir(), 'feed_icon'); try { - $app['media-alchemyst'] - ->open($media->getFile()->getPathname()) - ->turnInto($tmpname, $spec) - ->close(); + $app['media-alchemyst']->turnInto($media->getFile()->getPathname(), $tmpname, $spec); } catch (\MediaAlchemyst\Exception\ExceptionInterface $e) { throw new \Exception_InternalServerError('Error while resizing'); } diff --git a/lib/classes/appbox.php b/lib/classes/appbox.php index 6f94a6af4c..a3e0d657cb 100644 --- a/lib/classes/appbox.php +++ b/lib/classes/appbox.php @@ -101,10 +101,7 @@ class appbox extends base $tmp = tempnam(sys_get_temp_dir(), 'tmpdatabox') . '.jpg'; try { - $alchemyst - ->open($pathfile->getPathname()) - ->turninto($tmp, $imageSpec) - ->close(); + $alchemyst->turninto($pathfile->getPathname(), $tmp, $imageSpec); $filename = $tmp; } catch (\MediaAlchemyst\Exception $e) { @@ -118,10 +115,7 @@ class appbox extends base $tmp = tempnam(sys_get_temp_dir(), 'tmpdatabox') . '.jpg'; try { - $alchemyst - ->open($pathfile->getPathname()) - ->turninto($tmp, $imageSpec) - ->close(); + $alchemyst->turninto($pathfile->getPathname(), $tmp, $imageSpec); $filename = $tmp; } catch (\MediaAlchemyst\Exception $e) { @@ -196,10 +190,7 @@ class appbox extends base $tmp = tempnam(sys_get_temp_dir(), 'tmpdatabox') . '.jpg'; try { - $alchemyst - ->open($pathfile->getPathname()) - ->turninto($tmp, $imageSpec) - ->close(); + $alchemyst->turninto($pathfile->getPathname(), $tmp, $imageSpec); $filename = $tmp; } catch (\MediaAlchemyst\Exception $e) { diff --git a/lib/classes/databox/status.php b/lib/classes/databox/status.php index d9b510ebf1..e29943355b 100644 --- a/lib/classes/databox/status.php +++ b/lib/classes/databox/status.php @@ -449,10 +449,7 @@ class databox_status $destPath = sprintf("%s%s", $custom_path, basename($path . $name)); try { - $app['media-alchemyst'] - ->open($filePath) - ->turninto($destPath, $imageSpec) - ->close(); + $app['media-alchemyst']->turninto($filePath, $destPath, $imageSpec); } catch (\MediaAlchemyst\Exception $e) { } diff --git a/lib/classes/media/subdef.php b/lib/classes/media/subdef.php index 7792f028f8..e660a61572 100644 --- a/lib/classes/media/subdef.php +++ b/lib/classes/media/subdef.php @@ -563,9 +563,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface $specs->setRotationAngle($angle); try { - $alchemyst->open($this->get_pathfile()) - ->turnInto($this->get_pathfile(), $specs) - ->close(); + $alchemyst->turnInto($this->get_pathfile(), $this->get_pathfile(), $specs); } catch (\MediaAlchemyst\Exception\ExceptionInterface $e) { return $this; } diff --git a/lib/classes/patch/370a7.php b/lib/classes/patch/370a7.php index e8f85dc6aa..72010cec41 100644 --- a/lib/classes/patch/370a7.php +++ b/lib/classes/patch/370a7.php @@ -99,10 +99,7 @@ class patch_370a7 implements patchInterface $thumbPath = $app['root.path'] . '/tmp/lazaret/' . sprintf("thumb_%s", $row['filepath']); try { - $app['media-alchemyst'] - ->open($filePath) - ->turnInto($thumbPath, $spec) - ->close(); + $app['media-alchemyst']->turnInto($filePath, $thumbPath, $spec); } catch (MediaAlchemystException $e) { } diff --git a/lib/classes/record/adapter.php b/lib/classes/record/adapter.php index 2cba1076f6..0bec68b5f7 100644 --- a/lib/classes/record/adapter.php +++ b/lib/classes/record/adapter.php @@ -1007,9 +1007,11 @@ class record_adapter implements record_Interface, cache_cacheableInterface } try { - $app['media-alchemyst']->open($media->getFile()->getRealPath()) - ->turnInto($path_file_dest, $subdef_def->getSpecs()) - ->close(); + $app['media-alchemyst']->turnInto( + $media->getFile()->getRealPath(), + $path_file_dest, + $subdef_def->getSpecs() + ); } catch (\MediaAlchemyst\Exception\ExceptionInterface $e) { return $this; } @@ -1695,9 +1697,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface return; } - $alchemyst->open($this->get_hd_file()->getPathname()); - $alchemyst->turnInto($pathdest, $subdef_class->getSpecs()); - $alchemyst->close(); + $alchemyst->turnInto($this->get_hd_file()->getPathname(), $pathdest, $subdef_class->getSpecs()); } catch (\MediaAlchemyst\Exception\ExceptionInterface $e) { $logger->addError(sprintf('Subdef generation failed for record %d with message %s', $this->get_record_id(), $e->getMessage())); }