I need to know the width and height of the current instance of carrierwave
For example:
image_tag image.photo_url,:width => image.photo.width, :height => image.photo.height
But the problem is that image.photo.width and image.photo.height are not working.
Any ideas ?
You have to install ImageMagick, RMagick or MiniMagick. Then you open the file (image) before you can find out its height.
Example: https://github.com/jnicklas/carrierwave#conditional-versions (see the is_landscape? method), copied here:
Or this other related question:
Carrierwave and mini_magick finding widths & height