devfactorych / imagecache Goto Github PK
View Code? Open in Web Editor NEWLaravel 4/5 Package that crops and creates thumbnails of images
License: MIT License
Laravel 4/5 Package that crops and creates thumbnails of images
License: MIT License
$image will now contain an array with the following properties:
I am using this package and it returns an stdClass and not an array.
Good package btw.
There's an issue with the facade namespace and/or the documentation, which states to add this alias
'Imagecache' => 'Devfactory\Imagecache\Facades\ImagecacheFacade'
while the actual facades filepath is lower case. You should either update the docs with
'Imagecache' => 'Devfactory\Imagecache\facades\ImagecacheFacade',
or (recommended) refactor your namespaces.
Edit
There's another info that i think is misleading in the docs, since the ::get() method accepts as the first argument the plain filename, and then the configured path is automatically prepended.
I mean that Imagecache::get('somefile.jpg', 'preset') will work fine, while
Imagecache::get('path/to/somefile.jpg', 'preset') won't.
Just noticed this and i was wondering why, the $constraint->upsize()
is missing and it's not configurable in any way.
https://github.com/DevFactoryCH/imagecache/blob/master/src/Imagecache.php#L465
https://github.com/DevFactoryCH/imagecache/blob/master/src/Imagecache.php#L468
https://github.com/DevFactoryCH/imagecache/blob/master/src/Imagecache.php#L471
Is it a design choice?
What about scale an image without resize canvas?
For example... in Line 451 in ImageCache.php do resizeCanvas only if background is set in preset
if(isset($this->preset->background_color))
$image->resizeCanvas($this->preset->width, $this->preset->height, 'center', FALSE, $this->preset->background_color);
Hi, I've just chosen this plugin for my L5 project.
However, when I place the following: {!! Imagecache::get($image, '600x450')->img !!} the line stay empty when I check it into the source code. The $image is the same as full URL of any image, taken from another source. Tested also with a local image, from mine /images/, but still the same.
I've followed all the instructions, added my custom 600x450 class at imagecache.presets.php, as changed the url pointint to images/imagecache/ at imagecache.config.php.
Granted permission access 775 for imagecache.
Could you please advice ?
Hey super nice lib and simple to use.
I installed it and noticed that the path to the "Str" facade in Imagecache.php uses the "Str" alias but in my version of Laravel 5.0 that alias is not defined out of the box.
The issue is easily fixed by altering the path in Imagechache.php or just adding the alias.
The url generated for images will be http://
regardless.
I think a solution might be replacing the URL::asset
calls in the facade with the url()
helper, that should take into account current protocol, so if the user is browsing while in https the image will be resolved as https too.
What do you think?
Could you please add support for Laravel 7?
I think that being forced to keep all assets in one single directory is very limiting.
The Imagecache::get
method will search for files only in the configured directory and i think it would be a better practice to change its behaviour to allow for full path handling. For example:
I ask for Imagecache::get('somefile.jpg')
=> behaves as of now, looking in config directory
I ask for Imagecache::get('path/to/somefile.jpg')
=> load the file from public/path/to/somefile.jpg
the Devfactory\Imagecache config is not found in the php artisan config:publish list for laravel 5.5
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.