daxslab / yii2-thumbnailer

Yii2 extension to generate thumbnails for images of any size
MIT License
9 stars 4 forks source link

Thumbnailer generating url as file system path #11

Closed davidmpaz closed 2 years ago

davidmpaz commented 4 years ago

Hi 👋 !

thanks for the project. I am using now version 1.2.0 and my configuration in the frontend application looks like:

'thumbnailer' => [
            'class' => 'daxslab\thumbnailer\Thumbnailer',
            'thumbnailsBaseUrl' => '@web/assets/thumbnails',
            'enableCaching' => true,
],

One thing noticed is that the thumbnail directory is never generated. I created the directory with writable permissions and still nothing is written to it. I am using the thumbnailer as:

<?= Html::img(Yii::$app->thumbnailer->get('@web/img/default.jpg', 1000, 600), ['alt' => $defaultAlt]) ?>

I have checked the image url accessing directly to it so: http://app-test.local/img/default.jpg and i can load the image this way.

Having said this. When i check the image which is tried to being loaded is: https://app-test.local/var/www/html/frontend/img/default.jpg

Any idea on whats going wrong?

Thanks in advance, David

oatcpe commented 2 years ago

in Yii::$app->thumbnailer->get('@web/img/default.jpg'...

Please use full url path for image like Yii::$app->thumbnailer->get('http://test.com/img/default.jpg'...

davidmpaz commented 2 years ago

Thanks!