Set height and width of image field being rendered with views PHP The context: drupal 7, views, views PHP, rendering some fields with PHP because there's no other way.

$nodo = node_load($row-&gt;nid);
$strmn  = '&lt;div class="post-block"&gt;';
$strmn .= '&lt;div class="post-image"&gt;';
$image = field_get_items('node', $nodo, 'field_image');
$preout= field_view_value('node', $nodo, 'field_image', $image[0]);
$linko= url('node/'. $nodo-&gt;nid);
$strmn .= '&lt;a href="' . $linko . '"&gt;' . render($preout) . '&lt;/a&gt;';


After a lot of googling I've been able to write this.

It's very probably crude but it works, except I can't find a proper way to set height and width for the image. I don't want to create a style in drupal, it would be no good as it won't be used anywhere else. I also don't want, if at all possible, to rework my code to do something like:

$image = theme('image_style',array(
    'style_name' =&gt; 'mail_image_big',
    'path' =&gt; $image_obj['uri'],
    'attributes' =&gt; array('style' =&gt; 'border:1px solid #aaa;')
  )
);


Because my php is sketchy at best and the knowledge of the drupal API is null. Every change costs me a lot of time and energy because, honestly, I lack the basics and I'm not sure of what I'm doing until I do it right.

Finally: how do I set the $display array in field_view_value so that height and width are set the way I want them in my output html? I can't find an example or a list of valid properties I can set in the $settings array to save my life. :)
The context: drupal 7, views, views PHP, rendering some fields with
  PHP because there's no other way.


There definitely is another way, you're just not aware of it, this article was written 5 years ago:


  As of this writing, 44,497 site maintainers have read that warning and
  chosen to ignore it. They’ve chosen to put their PHP into a
  non-revisioned, difficult-to-access place, and to enable PHP input in
  a module that was never designed for security. They’ve left their site
  at risk of a very difficult to diagnose and even harder to fix WSOD.


I suggest that you fully read and understand that article and rethink your position about there being no other way.


  Because my PHP is sketchy at best and the knowledge of the drupal API
  is null. Every change costs me a lot of time and energy because,
  honestly, I lack the basics and I'm not sure of what I'm doing until I
  do it right.


Welcome to Drupal, it's a steep learning curve and if your knowledge of PHP is poor then you stand no chance of being able to understand Drupal, perhaps you could edit your question or provide a comment of what you're trying to achieve? I'm always surprised that beginner Drupalers dive straight into coding their way round a problem before investigating whether there is a non-code solution.

Finally, who cares whether an image style is going to be used anywhere else or not? It's not they are hard to set-up or cost anything.