href_link($page, $parameters, $connection, $add_session_id);
}
////
// The HTML image wrapper function
// -> OSCTHUMB112
function tep_image_original($src, $alt = '', $width = '', $height = '', $parameters = '') {
// <- OSCTHUMB112
if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
return false;
}
// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
$image = ' VIGN1
if ($get_size_image = @getimagesize($src)) {
$ratio_image_product = $get_size_image[0]/$get_size_image[1];
$ratio_image_print = $width/$height;
if ($ratio_image_product > $ratio_image_print) {
$height = $width / $ratio_image_product;
}
elseif($ratio_image_product < $ratio_image_print) {
$width = $height * $ratio_image_product;
}
}
// <- VIGN1
$image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
}
if (tep_not_null($parameters)) $image .= ' ' . $parameters;
$image .= '>';
return $image;
}
// -> OSCTHUMB112
////
// START oscThumb
// If you want to call the original function, you can call tep_image_original or call this one with $original=true.
function tep_image($src, $alt = '', $width = '', $height = '', $params = '', $original = false, $thumbnail_type = 0) {
global $oscthumb;
// We are asked to return the result of the original function
if ($original || $oscthumb->enabled==false) {
return tep_image_original ($src, $alt, $width, $height, $params);
}
$oscthumb->set_type ($src, $width, $height, $thumbnail_type); // Detect the type of image we are currently processing
if ($oscthumb->set_size ($src, $width, $height)==false) return false; // Choose the displayed width and height of the image, and if display something
$image = $oscthumb->process($src); // Returns the beginning of the image tag, like
OSCTHUMB112
// -> 0000015: catalogue PDF : problème de parsing
return tep_image_original(DIR_WS_IMAGES . $image, '', $width, $height);
// <- 0000015:
// <- OSCTHUMB112
}
////
// Output a form
function tep_draw_form($name, $action, $method = 'post', $parameters = '') {
$form = '