how to resize image programatically with theme image i need to resize image in my module output, but this code seems not working

$file = file_load($fid);
$image = theme('image', array('style_name'=&gt; 'small', 'path' =&gt; $file-&gt;uri, 'alt' =&gt; 'user picture'));


i am getting my image from database. i have created media type small to scale my image,
but style_name does not work.
You need to use theme_image_style() for that one:

$image = theme('image_style', array(
  'style_name'=&gt; 'small', 
  'path' =&gt; $file-&gt;uri, 
  'alt' =&gt; 'user picture'
));