dyjh 6 years ago
parent
commit
ece714e09e
1 changed files with 4 additions and 2 deletions
  1. 4 2
      app/Http/Controllers/Api/V1/AlbumPosterController.php

+ 4 - 2
app/Http/Controllers/Api/V1/AlbumPosterController.php

xqd xqd
@@ -176,13 +176,15 @@ class AlbumPosterController extends Controller
         $editor = Grafika::createEditor();
         $editor->open($image_poster, public_path() . '/base/poster/img/poster_canvas.png');
         $editor->open($image_poduct, str_replace(env('CDN_URL'), public_path(), $data['image']));
+        $editor->resizeExactWidth($image_poduct, 40);
+        $editor->resizeExactHeight($image_poduct, 40);
         $editor->blend($image_poster, $image_poduct, 'normal', 1, 'top-left', 10, 10);
         $font_bold = public_path() . '/base/poster/font/msyhbd.ttc';
         $font = public_path() . '/base/poster/font/msyh.ttc';
         for ($i = 0; $i <= 1; $i++) {
             $len = mb_strlen($info['introduce']);
             if ($len <= 17) {
-                $editor->text($image_poster, $info['introduce'], 22, 10, 460, new Color("#000000"), $font_bold, 0);
+                $editor->text($image_poster, $info['introduce'], 20, 10, 460, new Color("#000000"), $font_bold, 0);
                 break;
             }
             if ($i == 0) {
@@ -190,7 +192,7 @@ class AlbumPosterController extends Controller
             } else {
                 $text = mb_substr($info['introduce'], $i * 17, ($len - 17) > 10 ? 10 : ($len - 17));
             }
-            $editor->text($image_poster, $text, 22, 10, 460 + 50 * $i, new Color("#000000"), $font_bold, 0);
+            $editor->text($image_poster, $text, 20, 10, 460 + 50 * $i, new Color("#000000"), $font_bold, 0);
         }
         $editor->open($image_icon, public_path() . '/base/poster/img/phone.png');
         $editor->resizeExactWidth($image_icon, 40);