{"id":12541059,"date":"2020-03-13T14:55:50","date_gmt":"2020-03-13T14:55:50","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/wp_get_additional_image_sizes-retuning-true-if-image-is-smaller\/"},"modified":"2020-03-13T14:55:50","modified_gmt":"2020-03-13T14:55:50","slug":"wp_get_additional_image_sizes-retuning-true-if-image-is-smaller","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/wp_get_additional_image_sizes-retuning-true-if-image-is-smaller\/","title":{"rendered":"wp_get_additional_image_sizes retuning true if image is smaller"},"content":{"rendered":"<p>I&#8217;m confused with the functions wp_get_additional_image_sizes and has_image_size as they both return an array or true even if the fullsize image is smaller than this thumbsize.<\/p>\n<p>For example:<br \/>\nI have an image which is 196x196px<br \/>\nMy results listing requires a thumb of 260x260px, so I call has_image_size for the custom listing_thumb-260 thumb size.  It returns true.<br \/>\nIf you var_dump( wp_get_additional_image_sizes()[&#8216;listing_thumb-260&#8217;]) it returns:<br \/>\narray (size=3)<br \/>\n  &#8216;width&#8217; =&gt; int 260<br \/>\n  &#8216;height&#8217; =&gt; int 260<br \/>\n  &#8216;crop&#8217; =&gt; boolean true<br \/>\nBut this isn&#8217;t true the image is only 196px.<\/p>\n","protected":false},"template":"","class_list":["post-12541059","topic","type-topic","status-publish","hentry","topic-tag-image-size","topic-tag-thumbnail"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12541059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12541059\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=12541059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}