How do I get the correct URL of an image field? I'm trying to print out the URL of an image field using the following code.

&lt;img src="&lt;?php echo $field_company_logo['und'][0]['uri']; ?&gt;" alt="&lt;?php echo $company[0]['#markup']; ?&gt;" /&gt;


The code gives me a URI like public://company-logos/image.png when I would need sites/default/files/company-logos/image.png.

What code should I use to print the image path (i.e. sites/default/files/company-logos/image.png)?
You want to use the drupal_realpath() function to convert the URI into the actual filesystem path. 

echo drupal_realpath($field_company_logo['und'][0]['uri']);


You could also use file_create_url() to get the actual URL to the image, as opposed to a local filepath.

And the correct way to render an image is to run it through theme_image():

echo theme('image', array(
  'path' =&gt; file_create_url($field_company_logo['und'][0]['uri']),
  'alt' =&gt; check_plain($company[0]['#markup']),
));


Also, accessing field data the way you're doing it isn't the preferred method. Have a look at field_get_items() and the detailed example in the Rendering Drupal Fields (the right way) blog entry.