mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 05:23:21 +00:00
Update to latest media alchemyst api
This commit is contained in:
@@ -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) {
|
||||
|
||||
}
|
||||
|
@@ -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');
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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) {
|
||||
|
||||
}
|
||||
|
@@ -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()));
|
||||
}
|
||||
|
Reference in New Issue
Block a user