Comments (3)
Thank you! Can you post here how you are implementing the responsive method? Maybe the documentation is not correct, or maybe there is a bug, both are possible!!
from image.
I can't get this to work at all - I am getting 404 not found on the image returned with something like:
http://localhost/_img?img=/public/images/image.jpg&transform=resizeCrop,400,200
My url config in app.php is: 'http://localhost/laravel'
The image is set in 'public/images/image.jpg'
The imagecow.js is in public/js/imagecow.js
I am including the js like this:
<script type="text/javascript" src="<?php echo Config::get('app.url'); ?>/public/js/Imagecow.js"></script>
and the image like this:
<img src="{{ Image::path('/public/images/image.jpg', 'resizeCrop', 400, 200) }}" />
and here is my image config:
<?php
return array(
/**
* the image worker (GD / Immagick)
*/
'worker' => 'GD',
'route' => '/_img',
/**
* note this is the server path to the file
* from base_path()
*/
'js_path' => 'public\js\Imagecow.js',
/**
* various $_GET variables
*/
'vars' => array(
'image' => 'img',
'responsive_flag' => 'responsive',
'transform' => 'transform'
),
'cache' => array(
'lifetime' => 1,
'path' => 'images' // /app/storage/cache/{images}
)
);
Could you please advise how to get it to work or what am I missing?
from image.
The package assumes images are in the public directory so prepends the public path to them so you don't need to. You should call your image path as you would any image being rendered in your application as normal (ie without the /public prefix). So your example should be:
<img src="{{ Image::path('/images/image.jpg', 'resizeCrop', 400, 200) }}" />
The same should be for the javascript lib. The package actually includes a method to write the correct script tag (although it's not documented:
{{ Image::js() }}
Just add that in your <head>
from image.
Related Issues (20)
- Composer update fails HOT 8
- Cloudflare Caching HOT 1
- Issue with newest ImageCow? HOT 2
- no decode delegate for this image format `Gd' HOT 2
- Wrong namespace? HOT 5
- Missing ProviderCacher in Larvel's ServiceProvider HOT 2
- Undefined property $publicPath
- multiple responsive not working
- provider unknown variable
- image is not displaying on server while working on localhost HOT 9
- Conflict with Intervention/image HOT 1
- lifetime unit? HOT 1
- images not displaying: URI problem
- Laravel 5x compatibility? HOT 5
- Compression quality? HOT 1
- 'Undefined index: Imagecow_detection'
- css images are not loading in local but it working in wan HOT 1
- Silently Failing HOT 2
- Make available on Laravel 4.1 HOT 1
- Use base_path HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image.