Get file field alt text value using entity_metadata_wrapper I'm trying to get the alt title of a picture using the entity_metadata_wrapper.

My code is as follows:

$file = file_load($image["fid"]);
$file_wrapper = entity_metadata_wrapper('file', $file);


The $image is one of the images i got by using 

field_get_items("node", $node, "field_images")


If i try to get the alt text from the wrapper object, the result is null, although the alt text was set while creating the node.

var_dump($file_wrapper-&gt;field_file_image_alt_text);


outputs an EntityValueWrapper with type "text" and data "null".

var_dump($file_wrapper-&gt;field_file_image_alt_text-&gt;value());


returns null.

I don't understand why this is not working, is there any error in my thinking?
The file object does not contain the image metadata (Title, Alt,..). You must load the parent node to which the image is attached.

For example to get the Title of the 3rd image in the field "field_image" you would use:

$obj = entity_metadata_wrapper('node', $nid);
$obj-&gt;field_image[3]-&gt;title = $data;


Note 1: you do not have to load the node object first - the $nid variable can be the node id (entity_id)

Note 2: You should use the dpm() function to inspect the entity instead of var_dump. If you want to see also values of properties in the inspected entity, you can use a custom function. Google _wrapper_debug function to get it.