0

I already use yii2-file-kit. And now I want to resize my thumbnail by glide but I'be got error in log

"NetworkError: 500 Internal Server Error - http://storage.local/cache/1/iApQj79NQCji2TWsLZppiCQ8lbdgAPBz.jpg?w=100"

Here is my config

 'components' => [
    'cache' => [
        'class' => 'yii\caching\DummyCache',
    ],
'fileStorage' => [
        'class' => '\trntv\filekit\Storage',
        'baseUrl' => '@storageUrl/source',
        'filesystem' => [
            'class' => 'common\components\filesystem\LocalFlysystemBuilder',
            'path' => '@storage/web/source'
        ],
        'as log' => [
            'class' => 'common\behaviors\FileStorageLogBehavior',
            'component' => 'fileStorage'
        ]
    ],

    'glide' => [
        'class' => 'trntv\glide\components\Glide',
        'sourcePath' => '@storage/web/source',
        'cachePath' => '@storage/cache',
        'urlManager' => 'urlManagerStorage',
        'maxImageSize' => 4000000,
        'signKey' => 'pe4AJmRcBFbXfZvsk93VN'
    ],

And in my view

 <?= Html::img(
            Yii::$app->glide->createSignedUrl([
                'glide/index',
                'path' => $model->productAttachments[0]->path,
                'w' => 100
            ], true),
            ['class' => 'article-thumb img-rounded pull-left']
        ) ?>

I just look at Starter-Kit config and there is the same config as I see. storage config are the same as yii2-starter-kit

1 Answers1

0

Can you show debug for more information. Or you can output image by Url::base(true).'/glide?path='.$path.'&w='.$w.'&h='.$h.'&fit=crop';

dungphanxuan
  • 595
  • 5
  • 18