Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image::url returning url but image is not resized #34

Open
danielgroppo opened this issue Apr 17, 2017 · 2 comments
Open

Image::url returning url but image is not resized #34

danielgroppo opened this issue Apr 17, 2017 · 2 comments

Comments

@danielgroppo
Copy link

I'm trying to use this on Laravel 4.2, I have installed Imagine too and followed all steps (config publish, inclusive) with no error. When I call Image::url to make a resize of an image, this returns the url but the new image is not generated on the path.

Image::url($content->original_file_url,300,300)

If this line return the new url, the package is working in part, why the new image is not being generated?

@tontonsb
Copy link
Contributor

The image is not generated by this command. This is just a helper to get a route to the image like path/to/picture-image(300x300).jpg.

The image itself is created and returned when you actually call the url in the browser or similiarly. If you want the image not to be recreated every time but to be stored in your filesystem, you have to also specify write_image to be true in the config file (publish it first if you haven't done it).

P.S. Not sure about the recommended way, I usually either do url().Image::url($content->original_file_url,300,300) or asset(Image::url($content->original_file_url,300,300)) to get the absolute URL of the image.

@91Abdullah
Copy link
Contributor

You can also use

{{ Image::url(url('path/to/image'), 360, 470, ['crop' => true]) }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants