Resolving internal image paths? Inside my template.php I am populating a custom variable to be used inside my views-view-unformatted--latest_stories.tpl.php

The image data associated with the content type has the structure:

[field_photos] =&gt; Array
    (
        [und] =&gt; Array
            (
                [0] =&gt; Array
                    (
                        [fid] =&gt; 4
                        [uid] =&gt; 1
                        [filename] =&gt; DSCF2639_0.jpg
                        [uri] =&gt; public://story/photos/DSCF2639_0.jpg
                        [filemime] =&gt; image/jpeg
                        [filesize] =&gt; 129245
                        [status] =&gt; 1
                        [timestamp] =&gt; 1397504538
                        [alt] =&gt; 
                        [title] =&gt; 
                        [width] =&gt; 800
                        [height] =&gt; 600
                    )

                [1] =&gt; Array
                    (
                        [fid] =&gt; 5
                        [uid] =&gt; 1
                        [filename] =&gt; DSCF2657.jpg
                        [uri] =&gt; public://story/photos/DSCF2657.jpg
                        [filemime] =&gt; image/jpeg
                        [filesize] =&gt; 89144
                        [status] =&gt; 1
                        [timestamp] =&gt; 1397504538
                        [alt] =&gt; 
                        [title] =&gt; 
                        [width] =&gt; 800
                        [height] =&gt; 600
                    )

            )

    )


How do I translate the path to a URI which a browser will be able to resolve?

Do I simply strip the public:// 

What if I move my files to AWS at a later date? Is there a function in drupal API that will handle this for me???
You can use the handy file_create_url() function:


  Creates a web-accessible URL for a stream to an external or local file.