How to get default image sizes attribute

How do I get the height and width of default image sizes? I am not talking about custom image sizes, which can be retrieved from get_intermediate_image_sizes(). I want to get size attribute for ‘thumbnail’, ‘medium’, and ‘large’.

Update
Base on answer by Mridul Aggarwal, looks like i can do:

function get_image_size ($size) {
      return (array(get_option($size. '_size_w'),get_option($size. '_size_h')); 
}

Is this the only way?

2 Answers
2

If you want to get those set in the admin panel, use the function get_option. The keys are

get_option('thumbnail_size_w');
get_option('thumbnail_size_h');
get_option('medium_size_w');
get_option('medium_size_h');
get_option('large_size_w');
get_option('large_size_h');

If you want them for some specific attachment, use wp_get_attachment_image_src

Leave a Comment