|
@@ -42,6 +42,12 @@ class ImagesBusiness extends LuBusiness {
|
42
|
42
|
echo file_get_contents($dbo->getPath());
|
43
|
43
|
exit;
|
44
|
44
|
}
|
|
45
|
+
|
|
46
|
+ public static function prepareImage(\Imagick $image)
|
|
47
|
+ {
|
|
48
|
+ $image->scaleImage(420, 420, true);
|
|
49
|
+ $image->setImageFormat(self::IMAGES_FORMAT);
|
|
50
|
+ }
|
45
|
51
|
|
46
|
52
|
public static function upload(ImageUploadDbo $image, LuticateUsersDbo $_user)
|
47
|
53
|
{
|
|
@@ -55,9 +61,9 @@ class ImagesBusiness extends LuBusiness {
|
55
|
61
|
if (is_null($dbo->getName()) || $dbo->getName() === "") {
|
56
|
62
|
$dbo->setName(Carbon::now()->toW3cString());
|
57
|
63
|
}
|
|
64
|
+
|
|
65
|
+ self::prepareImage($image->getImage());
|
58
|
66
|
|
59
|
|
- $image->getImage()->scaleImage(420, 420, true);
|
60
|
|
- $image->getImage()->setImageFormat(self::IMAGES_FORMAT);
|
61
|
67
|
try
|
62
|
68
|
{
|
63
|
69
|
$image->getImage()->writeImage($path);
|