function cw_image_info($type, $image)
{
    global $available_images, $var_dirs_web;
    $image['in_type'] = $type;
    $image['type'] = cw_get_image_type($image['image_type']);
    if (!empty($image['image_path'])) {
        $id = $available_images[$type] == "U" ? "id" : "image_id";
        $image['tmbn_url'] = cw_image_get_url($image[$id], $type, $image['image_path']);
    } else {
        $image['tmbn_url'] = cw_get_default_image($type);
        $image['is_default'] = 1;
        if (!empty($image['tmbn_url'])) {
            $image['image_path'] = $var_dirs_web['images'] . '/' . $available_images[$type]['default_image'];
        }
    }
    return $image;
}
                }
            }
        }
        db_free_result($result);
        break;
    }
    if (!zerolen($image_path) && !is_url($image_path)) {
        if (!file_exists($image_path) || !is_readable($image_path)) {
            $image_path = "";
        } elseif ($config['setup_images'][$type]['md5_check'] == 'Y') {
            $image_md5 = md5_file($image_path);
        }
    }
    if (!zerolen($image_path) && $config['setup_images'][$type]['md5_check'] == 'Y' && $image_md5 !== $md5) {
        $image_path = "";
    }
}
if (zerolen($image_path)) {
    # when image is not available, use the "default image"
    $type = $orig_type;
    $image_path = cw_get_default_image($type);
    $tmp = cw_get_image_size($image_path);
    $image_size = $tmp[0];
    $image_type = empty($tmp[3]) ? "image/gif" : $tmp[3];
}
header("Content-Type: " . $image_type);
if ($image_size > 0) {
    header("Content-Length: " . $image_size);
}
cw_readfile($image_path, true);
exit;
$success = false;
if (!isset($domain_id)) {
    cw_flush('No domains specified');
    $top_message = array('content' => 'No domains specified', 'type' => 'W');
    return false;
}
cw_load('product', 'xml', 'category', 'image', 'attributes');
// Google Product Search fields accordint to the spec
// http://www.google.com/support/merchants/bin/answer.py?answer=188494
$xml_fields = array('g:id', 'title', 'description', 'g:google_product_category', 'g:product_type', 'link', 'g:image_link', 'g:additional_image_link', 'g:condition', 'g:availability', 'g:price', 'g:brand', 'g:gtin', 'g:mpn', 'g:item_group_id', 'g:color', 'g:material', 'g:pattern', 'g:size', 'g:gender', 'g:age_group', 'g:shipping_weight', 'g:expiration_date');
if ($addons['multi_domains']) {
    $domain = cw_func_call('cw_md_domain_get', array('domain_id' => $domain_id));
}
$default_thumb = cw_get_default_image('products_images_thumb');
$default_det = cw_get_default_image('products_images_det');
// Get all attributes of this addon
$gb_attr = array();
global $google_base_attributes_map;
$gb_attributes_full = cw_call('cw_get_attributes_by_addon', array('google_base'));
foreach ($gb_attributes_full as $gbv) {
    $gb_attr[$gbv['field']] = $gbv['attribute_id'];
    if (!empty($google_base_attributes_map[$gbv['field']])) {
        $mapped_attr = cw_func_call('cw_attributes_get_attributes_by_field', array('field' => $google_base_attributes_map[$gbv['field']]));
        if (!empty($mapped_attr['P'])) {
            $gb_attr[$gbv['field']] = $mapped_attr['P'];
        }
    }
}
unset($gb_attributes_full, $gbv, $mapped_attr);
$_filename = $config['google_base']['gb_filename'];