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);
|
$spec->setDimensions(375, 275);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->app['media-alchemyst']
|
$this->app['media-alchemyst']->turnInto($file->getFile()->getPathname(), $lazaretPathnameThumb, $spec);
|
||||||
->open($file->getFile()->getPathname())
|
|
||||||
->turnInto($lazaretPathnameThumb, $spec)
|
|
||||||
->close();
|
|
||||||
} catch (MediaAlchemystException $e) {
|
} catch (MediaAlchemystException $e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -141,10 +141,7 @@ class Publications implements ControllerProviderInterface
|
|||||||
$tmpname = tempnam(sys_get_temp_dir(), 'feed_icon');
|
$tmpname = tempnam(sys_get_temp_dir(), 'feed_icon');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$app['media-alchemyst']
|
$app['media-alchemyst']->turnInto($media->getFile()->getPathname(), $tmpname, $spec);
|
||||||
->open($media->getFile()->getPathname())
|
|
||||||
->turnInto($tmpname, $spec)
|
|
||||||
->close();
|
|
||||||
} catch (\MediaAlchemyst\Exception\ExceptionInterface $e) {
|
} catch (\MediaAlchemyst\Exception\ExceptionInterface $e) {
|
||||||
throw new \Exception_InternalServerError('Error while resizing');
|
throw new \Exception_InternalServerError('Error while resizing');
|
||||||
}
|
}
|
||||||
|
@@ -101,10 +101,7 @@ class appbox extends base
|
|||||||
$tmp = tempnam(sys_get_temp_dir(), 'tmpdatabox') . '.jpg';
|
$tmp = tempnam(sys_get_temp_dir(), 'tmpdatabox') . '.jpg';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$alchemyst
|
$alchemyst->turninto($pathfile->getPathname(), $tmp, $imageSpec);
|
||||||
->open($pathfile->getPathname())
|
|
||||||
->turninto($tmp, $imageSpec)
|
|
||||||
->close();
|
|
||||||
$filename = $tmp;
|
$filename = $tmp;
|
||||||
} catch (\MediaAlchemyst\Exception $e) {
|
} catch (\MediaAlchemyst\Exception $e) {
|
||||||
|
|
||||||
@@ -118,10 +115,7 @@ class appbox extends base
|
|||||||
$tmp = tempnam(sys_get_temp_dir(), 'tmpdatabox') . '.jpg';
|
$tmp = tempnam(sys_get_temp_dir(), 'tmpdatabox') . '.jpg';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$alchemyst
|
$alchemyst->turninto($pathfile->getPathname(), $tmp, $imageSpec);
|
||||||
->open($pathfile->getPathname())
|
|
||||||
->turninto($tmp, $imageSpec)
|
|
||||||
->close();
|
|
||||||
$filename = $tmp;
|
$filename = $tmp;
|
||||||
} catch (\MediaAlchemyst\Exception $e) {
|
} catch (\MediaAlchemyst\Exception $e) {
|
||||||
|
|
||||||
@@ -196,10 +190,7 @@ class appbox extends base
|
|||||||
$tmp = tempnam(sys_get_temp_dir(), 'tmpdatabox') . '.jpg';
|
$tmp = tempnam(sys_get_temp_dir(), 'tmpdatabox') . '.jpg';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$alchemyst
|
$alchemyst->turninto($pathfile->getPathname(), $tmp, $imageSpec);
|
||||||
->open($pathfile->getPathname())
|
|
||||||
->turninto($tmp, $imageSpec)
|
|
||||||
->close();
|
|
||||||
$filename = $tmp;
|
$filename = $tmp;
|
||||||
} catch (\MediaAlchemyst\Exception $e) {
|
} catch (\MediaAlchemyst\Exception $e) {
|
||||||
|
|
||||||
|
@@ -449,10 +449,7 @@ class databox_status
|
|||||||
$destPath = sprintf("%s%s", $custom_path, basename($path . $name));
|
$destPath = sprintf("%s%s", $custom_path, basename($path . $name));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$app['media-alchemyst']
|
$app['media-alchemyst']->turninto($filePath, $destPath, $imageSpec);
|
||||||
->open($filePath)
|
|
||||||
->turninto($destPath, $imageSpec)
|
|
||||||
->close();
|
|
||||||
} catch (\MediaAlchemyst\Exception $e) {
|
} catch (\MediaAlchemyst\Exception $e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -563,9 +563,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
$specs->setRotationAngle($angle);
|
$specs->setRotationAngle($angle);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$alchemyst->open($this->get_pathfile())
|
$alchemyst->turnInto($this->get_pathfile(), $this->get_pathfile(), $specs);
|
||||||
->turnInto($this->get_pathfile(), $specs)
|
|
||||||
->close();
|
|
||||||
} catch (\MediaAlchemyst\Exception\ExceptionInterface $e) {
|
} catch (\MediaAlchemyst\Exception\ExceptionInterface $e) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@@ -99,10 +99,7 @@ class patch_370a7 implements patchInterface
|
|||||||
$thumbPath = $app['root.path'] . '/tmp/lazaret/' . sprintf("thumb_%s", $row['filepath']);
|
$thumbPath = $app['root.path'] . '/tmp/lazaret/' . sprintf("thumb_%s", $row['filepath']);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$app['media-alchemyst']
|
$app['media-alchemyst']->turnInto($filePath, $thumbPath, $spec);
|
||||||
->open($filePath)
|
|
||||||
->turnInto($thumbPath, $spec)
|
|
||||||
->close();
|
|
||||||
} catch (MediaAlchemystException $e) {
|
} catch (MediaAlchemystException $e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1007,9 +1007,11 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$app['media-alchemyst']->open($media->getFile()->getRealPath())
|
$app['media-alchemyst']->turnInto(
|
||||||
->turnInto($path_file_dest, $subdef_def->getSpecs())
|
$media->getFile()->getRealPath(),
|
||||||
->close();
|
$path_file_dest,
|
||||||
|
$subdef_def->getSpecs()
|
||||||
|
);
|
||||||
} catch (\MediaAlchemyst\Exception\ExceptionInterface $e) {
|
} catch (\MediaAlchemyst\Exception\ExceptionInterface $e) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@@ -1695,9 +1697,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$alchemyst->open($this->get_hd_file()->getPathname());
|
$alchemyst->turnInto($this->get_hd_file()->getPathname(), $pathdest, $subdef_class->getSpecs());
|
||||||
$alchemyst->turnInto($pathdest, $subdef_class->getSpecs());
|
|
||||||
$alchemyst->close();
|
|
||||||
} catch (\MediaAlchemyst\Exception\ExceptionInterface $e) {
|
} catch (\MediaAlchemyst\Exception\ExceptionInterface $e) {
|
||||||
$logger->addError(sprintf('Subdef generation failed for record %d with message %s', $this->get_record_id(), $e->getMessage()));
|
$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