There is no such method available to apply classes directly from node.tpl.php
You can achieve it by using theme function theme_image_style
e.g, in template.php
/**
* Theme override
*
* Add custom class to image styles
*/
function MY_THEME_image_style($variables) {
// Determine the dimensions of the styled image.
$dimensions = array(
'width' => $variables['width'],
'height' => $variables['height'],
);
image_style_transform_dimensions($variables['style_name'], $dimensions);
$variables['width'] = $dimensions['width'];
$variables['height'] = $dimensions['height'];
// Determine the URL for the styled image.
$variables['path'] = image_style_url($variables['style_name'], $variables['path']);
/* Begin custom snippet */
// Add or append custom classes, to avoid clobbering existing
if (isset($variables['attributes']['class'])) {
$variables['attributes']['class'] += array('my-class', $variables['style_name']);
}else{
$variables['attributes']['class'] = array('my-class', $variables['style_name']);
}
/* End custom snippet */
return theme('image', $variables);
}
Note: This is just a clone of theme_image_style with the custom classes added at the end.
You can add some conditional logic based on style_name for specific classes, and also do a similar thing with theme_image if needed.