Wondering if anyone can help - I was wondering - what's the best most elegant way for a .tpl to sniff out which workarea its in? (not dcr ofile or pt path) this is a frequent occurrence for me since I often need to know the full path to images and associated files for scripting output. Right now I use some variation of getting the dcr path, matching the workareas and doing if/elses to construct basepaths, but its all so clunky.
isn't there just a "get_WA" method or something? in absence of that there might be a better way to do what I'm doing..
More specifically I have code that uses Image:

ize to get the height and width of images without content people having to enter it in the template:
use Image:

ize;
$main_image = iwpt_dcr_value( 'dcr.MAIN_FEATURE.image' );
##### here's what I'd like to optimize ######
$dcr_name = iwpt_get_dcr_name();
( $branch_path, $wa_file ) = split( /WORKAREA/ , $dcr_name );
if ( $wa_file =~ /content/ ) {
$branch_WA = $branch_path . "WORKAREA/content";
}
else {
$branch_WA = $branch_path . "WORKAREA/presentation";
}
$fullpath_main_image = $branch_WA . $main_image;
####################################
($main_image_width, $main_image_height) = imgsize( $fullpath_main_image );
thanks for any help or input on this..