sadovojav / yii2-image-thumbnail Goto Github PK
View Code? Open in Web Editor NEWCreate image thumbnail Yii2 component
License: GNU General Public License v3.0
Create image thumbnail Yii2 component
License: GNU General Public License v3.0
Please fix the readme that the last fix changed basePath to null
Problem 1
- Installation request for sadovojav/yii2-image-thumbnail dev-master -> satisfiable by sadovojav/yii2-image-thumbnail[dev-master].
- sadovojav/yii2-image-thumbnail dev-master requires bower-asset/holderjs 2.8 -> no matching package found.
PHP Notice โ yii\base\ErrorException
Undefined index: placeholder
1. in /app/vendor/sadovojav/yii2-image-thumbnail/Thumbnail.php at line 72
70 public function init()
71 {
72 $this->options['placeholder'] = count($this->options['placeholder'])
73 ? array_merge($this->defaultOptions['placeholder'], $this->options['placeholder'])
I think is not possible for example to create a thumbnail with a fix width and auto height (keeping the aspect ratio).
In many cases this I think this will be useful
http://placeholdit.imgix.net/ seems to have moved, so the placeholder type PLACEHOLDER_TYPE_URL is no longer working.
This format option is set in $defaultOptions but never used in init() function to set $this->options['format']
The code bellow throw me an error (Undefined index: format)
yii2-image-thumbnail/Thumbnail.php
Line 330 in 880a4f5
hi. thank you for this.i am a first watcher !
but i cant install with composer! how to install manually?
Hello, I dont know why but for me is not working.
this is my code
echo Yii::$app->thumbnail->img( Yii::getAlias('@webroot/images/products/'.$r['images']), [
'thumbnail' => [
whidth' => 280,
'height' => 300,
],
'placeholder' => [
'width' => 280,
'height' => 300
]
]);
and produce this code
... src="/thumbnails/f5/f5e022a013b424919e87b5ece81cd7bc.jpg" ....
now, I am in local, I try to create a folder name thumbnails in:
applications/MAMP/htdocs
the getAlias is correct.
I make some error?
thanks
You can change the scope of methods from private to protected?
Thx!
It seems to me that the placeholder types PLACEHOLDER_TYPE_JS and PLACEHOLDER_TYPE_IMAGINE ignore the Yii base URL (see https://www.yiiframework.com/doc/guide/2.0/en/concept-aliases#predefined-aliases ).
That is, if your app is running at www.tld.com/path/to/app/ instead of at www.tld.com/, placeholder URLs will be generated for the root of the path:
with PLACEHOLDER_TYPE_JS: www.tld.com/holder.js?params=... (HTTP 404) instead of www.tld.com/path/to/app/assets/.../holder.js?params=...
with PLACEHOLDER_TYPE_IMAGINE : www.tld.com/thumbnails/... (HTTP 404)
instead of www.tld.com/path/to/app/thumbnails/...
I'm using these settings:
'thumbnail' => [
'class' => 'sadovojav\image\Thumbnail',
'cachePath' => '@webroot/thumbnails',
'prefixPath' => '@web',
'options' => [
'placeholder' => [
'type' => sadovojav\image\Thumbnail::PLACEHOLDER_TYPE_IMAGINE
]
]
],
Am I missing or misunderstanding something?
Edit: I think #9 could be related.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.