Is there a simple way to get image dimensions in Ruby?

As of June 2012, FastImage which “finds the size or type of an image given its uri by fetching as little as needed” is a good option. It works with local images and those on remote servers. An IRB example from the readme: require ‘fastimage’ FastImage.size(“http://stephensykes.com/images/ss.com_x.gif”) => [266, 56] # width, height Standard array assignment … Read more

VideoView to match parent height and keep aspect ratio

You should extends from the built-in video view. Call setVideoSize before video view is shown, you can get video size from thumbnail extracted from video. So that, when video view’s onMeasure is called, both mVideoWidth & mVideoHeight are > 0. If you want to account the height of controllers, you can do it yourself in … Read more

Assigning ‘wrap_content’ or ‘-2’ to dimension

To use wrap_content or match_parent you need to create following items in dimens.xml file: <item name=”match_parent” format=”integer” type=”dimen”>-1</item> <item name=”wrap_content” format=”integer” type=”dimen”>-2</item> Then you can simply use it like this: <dimen name=”layout_height”>@dimen/match_parent</dimen> <dimen name=”layout_width”>@dimen/wrap_content</dimen>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)