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

Add documentation for image.js #15

Open
phrfpeixoto opened this issue Sep 17, 2015 · 1 comment
Open

Add documentation for image.js #15

phrfpeixoto opened this issue Sep 17, 2015 · 1 comment

Comments

@phrfpeixoto
Copy link

Please add some documentation on Image.js file.

What is it? In where scenarios i need to include it?

@dmongeau
Copy link
Member

You are right, needs documentation.

For now, here is a little explanation. The image.js library is used only to generate URL in javascript. So if you want to create and URL for a 300x300 image you will do something like this:

var img = document.createElement('img');
img.src = Image.url('/path/to/your/image', 300, 300, {
    'crop': true
});

Basically, it's a javascript equivalent of the Image::url() method available in PHP.

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

2 participants