sadovojav / yii2-gallery-module

Yii2 gallery module
13 stars 7 forks source link

Why image echo whit backslashes? #2

Open gorsargsyan opened 9 years ago

gorsargsyan commented 9 years ago

untitled

sadovojav commented 9 years ago

You must change basePath in module config basePath = @webroot/galleries - defailt

I use this config for my projects (Yii2 advanced)

        'gallery' => [
            'class' => 'sadovojav\gallery\Module',
            'basePath' => '@root/uploads/galleries',
        ],

Isset string in common\config\bootstrap

Yii::setAlias('root', dirname(dirname(__DIR__)));

And .htaccess has RewriteRule ^uploads/(.*)$ uploads/$1 [L]

In general you must set correctly basePath, and customize you .htaccess if need.

sadovojav commented 9 years ago

@gorsargsyan In Windows system URL with backslashes "\" is used. Mac and Linux systems have common slash "/"

gorsargsyan commented 9 years ago

can we crop images?

sadovojav commented 9 years ago

You can use this extension https://github.com/sadovojav/yii2-image-thumbnail, and crop image when you display gallery. Image-thumbnail use cache image, and create it at first start.

gvital3230 commented 8 years ago

Very useful module, thank you.

Need your advice - what is the best way to set modal cropping tool (https://github.com/sadovojav/yii2-image-cutter or https://github.com/fengyuanchen/cropper) to be used as "edit" command in gallery manager?

sadovojav commented 8 years ago

gvital3230, I recommend this extension: https://github.com/sadovojav/yii2-image-thumbnail to crop/resize image. This extension create thumbnails dynamically. If you want crop image some self, you must use native cropper plugins, ajax, and imagine or other image library.