Create imagefield and set min width and height programmatically I've created an image field programmatically in Drupal 7. I want to set a minimum width and a minimum height on the image, so it checks whether the image is large enough.

The imagefield I've created:

$form['box_image'] = array(
    '#type' =&gt; 'media',
    '#title' =&gt; t('Image'),
    '#default_value' =&gt; isset($content['settings']['box_image']) ? $content['settings']['box_image'] : '',
    '#theme' =&gt; 'media_widget',
    '#media_options' =&gt; array(
      'global' =&gt; array(
        'types' =&gt; array('image'),
        'schemes' =&gt; array(
          'public' =&gt; 'public',
        ),
        'file_extensions' =&gt; 'png gif jpg jpeg',
        'max_filesize' =&gt; '500 KB',
        'uri_scheme' =&gt; 'public',
        // Can I set the min width and height here?
      ),
    ),
);


Is this possible? Thanks.
Problem solved. If you use Media browser, like me you could use:
'min_resolution' =&gt; '750x500'.