forked from verdnatura/hedera-web
refs #5553 Insert/Update image table before save
This commit is contained in:
parent
42f682739e
commit
74980fbdd7
|
@ -1,4 +1,4 @@
|
||||||
hedera-web (23.6.9) stable; urgency=low
|
hedera-web (23.6.10) stable; urgency=low
|
||||||
|
|
||||||
* Initial Release.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "hedera-web",
|
"name": "hedera-web",
|
||||||
"version": "23.6.9",
|
"version": "23.6.10",
|
||||||
"description": "Verdnatura web page",
|
"description": "Verdnatura web page",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -101,12 +101,6 @@ class Upload extends Vn\Web\JsonRequest {
|
||||||
$symbolicSrc = "../full/$fileName";
|
$symbolicSrc = "../full/$fileName";
|
||||||
|
|
||||||
$image = Image::create($tmpName);
|
$image = Image::create($tmpName);
|
||||||
Image::resizeSave($image, $fullFile, $info['maxHeight'], $info['maxWidth']);
|
|
||||||
|
|
||||||
foreach ($info['sizes'] as $size => $i) {
|
|
||||||
$dstFile = "$collectionPath/$size/$fileName";
|
|
||||||
Image::resizeSave($image, $dstFile, $i['height'], $i['width'], $i['crop'], $symbolicSrc);
|
|
||||||
}
|
|
||||||
|
|
||||||
$query =
|
$query =
|
||||||
"INSERT INTO `image`
|
"INSERT INTO `image`
|
||||||
|
@ -121,6 +115,13 @@ class Upload extends Vn\Web\JsonRequest {
|
||||||
'name' => $name
|
'name' => $name
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Image::resizeSave($image, $fullFile, $info['maxHeight'], $info['maxWidth']);
|
||||||
|
|
||||||
|
foreach ($info['sizes'] as $size => $i) {
|
||||||
|
$dstFile = "$collectionPath/$size/$fileName";
|
||||||
|
Image::resizeSave($image, $dstFile, $i['height'], $i['width'], $i['crop'], $symbolicSrc);
|
||||||
|
}
|
||||||
|
|
||||||
imagedestroy($image);
|
imagedestroy($image);
|
||||||
unlink($tmpName);
|
unlink($tmpName);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in New Issue