Trying to set an image URL using a global asset field I've setup a global asset field so that a client can change a placeholder image that gets used throughout their website. I'm using the Imager plugin for my image transforms.

The following image code works fine when using a hard-coded image URL:

{% set image = 'http://placehold.it/450x225/eee/eee' %}
{% set transformedImage = craft.imager.transformImage(image, { width: 450, height: 225, }) %}
&lt;img src="{{ transformedImage.url }}" /&gt;


But when I replace the hard-coded image URL with the global asset field, it doesn't work:

{% set image = '{{ websitePreferences.placeholderImage.first.url }}' %}
{% set transformedImage = craft.imager.transformImage(image, { width: 450, height: 225, }) %}
&lt;img src="{{ transformedImage.url }}" /&gt;


I get this error message (Craft/Exception):


  Source folder “/Users/stephen/Repositories/repo-name-here/public_html./” does not exist


If I output the global asset field elsewhere in the template, I get this:


  http://my-locl-url.dev/uploads/images/Placeholders/placeholder-image.png


If I hard-code this URL into my image code, the image works fine. So does anyone have any idea why using a global for the placeholder image in this way isn't working? Thanks for any help.
I don't know if it's the cause of the error you're receiving or not, but this is incorrect Twig syntax:

{% set image = '{{ websitePreferences.placeholderImage.first.url }}' %}


You'll never need to nest {{ }} inside of {% %} or visa versa in Twig.

This is correct:

{% set image = websitePreferences.placeholderImage.first() %}