kevbaldwyn / image Goto Github PK
View Code? Open in Web Editor NEWResponsive images and on the fly image sizing for laravel 4 and fuel php
Responsive images and on the fly image sizing for laravel 4 and fuel php
Consider this scenary:
$images is an array with to strings 1.jpg and 2.jpg
@foreach ($images as $img)
<img src="{{ Image::path($img, 'resizeCrop', 350, 350) }}" />
@Endforeach
There is the generated url for each image
1 = _img?img=1.jpg&transform=resizeCrop,350,350
2 = _img?img=1.jpg&transform=resizeCrop,350,350img=2.jpg&transform=resizeCrop,350,350
The url of 2.jpg is appended to first url.
I've check the path function and it seems to be related to pathString member of Image object. Maybe it have to be reset to route default value on each call?
Hi,
I keep on having the same exception:
'ErrorException' with message 'Undefined index: Imagecow_detection' in /home/frontoff/public_html/laravel/vendor/kevbaldwyn/image/src/KevBaldwyn/Image/Image.php:265
Even if I don't use responsive method. How can I fix this ?
Thanks in advance.
Hi i have an issue when i use
Image::path('/someimage.jpg', 'resizeCrop', 400, 200)
i get no decode delegate for this image format Gd' or no decode delegate for this image format
Imagick'
i have installed imagic and gd and they are shown with php_info
Just found this. Looks amazing. Thanks for putting together.
A quickie... It's it L5 compatible?
Thanks. Keep it up!
I'm receiving an error with the image cache and couldn't see a resolution in the readme.
I have /app/storage/cache set to 777 and there are new files and folders created.
It works on my local Windows machine but not on the CentOS server.
Exception
There was an error with the image cache
open: /home/appfolder/vendor/kevbaldwyn/image/src/KevBaldwyn/Image/Image.php
if($cacheData) {
// using cache
if (($string = $cacheData['data']) && ($mimetype = $cacheData['mime'])) {
header('Content-Type: '.$mimetype);
die($string);
}else{
throw new \Exception('There was an error with the image cache');
}
Hi Kevin,
It seems you forgot to assign $publicPath
in here
https://github.com/kevbaldwyn/image/blob/master/src/KevBaldwyn/Image/Cache/ProviderCacher.php#L26
Best
Wen I follow installation path for laravel 4 I see the suggestion to add in providers list 'KevBaldwyn\Image\ImageServiceProvider' but it causes error "PHP Fatal error: Class 'KevBaldwyn\Image\ImageServiceProvider' not found" after investigating ImageServiceProvider.php I found that corrct namespace of that class is 'KevBaldwyn\Image\Providers\Laravel\ImageServiceProvider' Maybe you can change the installation description? or I dont understand something or do something wrong?
it adds multiple times responsive=true in the url witch mess up imagecow detection and only the first media query work
&transform=resizeCrop,360,200;max-width=400:resizeCrop,345,192&responsive=true;max-width=700:resizeCrop,637,200&responsive=true
it should be
&transform=resizeCrop,360,200;max-width=400:resizeCrop,345,192;max-width=700:resizeCrop,637,200&responsive=true
Hi Kevin
After composer update
I got an error:
Class 'KevBaldwyn\Image\Providers\Laravel\ProviderCacher' not found
It seems you forgot to use KevBaldwyn\Image\Cache\ProviderCacher;
in KevBaldwyn\Image\Providers\Laravel\ImageServiceProvider
. I add that line and it works.
Best
I'm not sure if this is affecting anyone else, but I'm having issues recently and I think it may be related to ImageCow.
I'm receiving this error. The sting being passed appears to be empty, but I can't find where it's being called in :/
Zero size image string passed
open: /home/rvwd/vendor/imagecow/imagecow/Imagecow/Libs/Imagick.php
*
* @return \Imagick
*/
public static function createFromString ($string)
{
$imagick = new \Imagick();
$imagick->readImageBlob($string);
return new static($imagick);
I was thinking about adding some notes to describe creating the folder for the image cache, and setting it to be writable. The library silently fails (no exceptions) when the folder is not writable, and all you get is a broken link on the page.
In Image@serve method line 64 i think there is a wrong function call, the image path is being build using the application base path, maybe its better to call public_path() there?
I can not install this with composer.
Here's the error: http://d.pr/i/JbP9
Hi,
Here's the weird thing:
Let's say I use this in one of my views:
<img src="{{ Image::path('/img/carousels/visual.jpg', 'resize', 100) }}" />
It's rendered in my browser as
<img src="/_img?img=/img/carousels/visual.jpg&transform=resize,100" />
The thing is, it's a broken image because it's looking for this URL
http://localhost/_img?img=/img/carousels/visual.jpg&transform=resize,100
But if I try this URL http://localhost/laravel/public/_img?img=/img/carousels/visual.jpg&transform=resize,100
, it's working just fine, I can see the image resized.
I don't know why the url is not rendered properly. Anyway, I can't make the package work. Any help is appreciated, thanks in advance!
Hi,
I see that it's possible to chose the lifetime of the cache in the config. But what is the unit of the lifetime?
Hi
It appears that any image I serve through this plugin doesn't get cached through Cloudflare, whereas my standard images will. I haven't had time to fully investigate this, perhaps an issue with the URL or headers?
In the code there are these comments...
// is there ant merit in this being base_path()?
// if it was base_path() then any image on the filesystem could be served - is this actually desirable?
I suggest it would make sense to change this, as normally you'd want to be processing images which have been uploaded - and you wouldn't want to be uploading to the public folder.
delete
provider unknown variable
images/provider/Laravel/ImageServiceProvider.php
private function registerImageFileSaveHandler()
{
$app = $this->app;
$this->app->bind('kevbaldwyn.image.saveHandler', function() use ($app) {
//return new S3Handler();
return new FileSystem($provider, '');
});
}
This rarely happen in production we use two image manipulation library at same time, but when developing we will check one compare another library and I found that this library not working when we have library from https://github.com/Intervention/image enabled in providers.
Route::get('ok', function(){
// ImageSrc aliases for kevbaldwyn/image
return ImageSrc::path('image.jpg', 'resizeCrop', 400, 200);
});
?=image.jpg&=resizeCrop,400,200
/_img?img=image.jpg&transform=resizeCrop,400,200
It's would be nice, if this can be fixed.
using this package on localhost is going perfectly fine ... No issues are there
But when I switch to server imag is not being displayed over there on browser.
tried alot ... checked almost every possible configuration
Just came across this package and it looks great. However, I'm unable to install it as it requires Laravel 4.0.x. Could it be updated to allow for Laravel 4.1.x also?
Hi,
Is it possible to set image quality specifically and not as a global setting?
Trying to use the ->responsive method and getting a 404 on the image returned. When the ->responsive method is removed, the image works great. Otherwise, the package is great. Keep up the good work! I am using Laravel v4.
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.