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

cl_image_tag adds non-dynamic height/width for :crop => :fit #26

Closed
aaronchi opened this issue Aug 22, 2012 · 2 comments
Closed

cl_image_tag adds non-dynamic height/width for :crop => :fit #26

aaronchi opened this issue Aug 22, 2012 · 2 comments

Comments

@aaronchi
Copy link

When using cl_image_tag with :crop => :fit, it passes the non-dynamic height/width variables to the image tag which makes the image size incorrectly.

For example:

cl_image_tag(bonus.image.filename, :width => 250, :height => 250, :crop => :fit)

This always produces an image tag with height=250 and width=250 regardless of how the image is cropped. cl_image_tag should not pass through the height and width if crop is set to fit or should use a different variable to pass the cloudinary vs the image options.

@nadavs
Copy link
Contributor

nadavs commented Aug 23, 2012

Thank you for reporting this issue.
We should indeed fix cl_image_tag not to add the width & height attributes when 'fit' or 'limit' crop modes are used.
In the meantime, there's an easy workaround. Simply use :html_width and :html_height. For example:

cl_image_tag("sample.jpg", :width => 250, :height => 250, :crop => :fit, :html_width => nil, :html_height => nil)

@nadavs
Copy link
Contributor

nadavs commented Sep 2, 2012

This issue was fixed in v1.0.34. Width & Height are not passed to the image tag in 'fit' and 'limit' crop modes.

@nadavs nadavs closed this as completed Sep 2, 2012
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