Probably coming at this from too much of a Drupal 6 view point but...
How do I theme an image in a given image style when that image lives in a module folder? This is driving me batty and I know I'm just missing something simple.
Here is some example code showing what I'm trying to do:
$file_uri = 'public://sites/all/modules/my_module/logo.jpg';
$data['logo'] = theme('image_style', array('style_name' => 'medium', 'path' => $file_uri));
Even if I use file_build_uri(), I end up with a path to a file that doesn't exist. If I move the image to the files directory and change the $file_uri to 'public://logo.jpg', it works just fine.
Do I need to copy the image to the files directory as part of the module code? If so, isn't this ridiculous?
What am I missing? Is there documentation on how to do something like this? I've spent over an hour mining the Drupal documentation and came up completely dry.