diff options
Diffstat (limited to 'include/functions_picture.inc.php')
-rw-r--r-- | include/functions_picture.inc.php | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/include/functions_picture.inc.php b/include/functions_picture.inc.php index aac3e45b1..2e0f40d5d 100644 --- a/include/functions_picture.inc.php +++ b/include/functions_picture.inc.php @@ -23,52 +23,6 @@ /* - * @param element_info array containing element information from db; - * at least 'id', 'path', 'has_high' should be present - */ -function get_high_path($element_info) -{ - $path = get_high_location($element_info); - if (!empty($path) and !url_is_remote($path) ) - { - $path = PHPWG_ROOT_PATH.$path; - } - return $path; -} - -/** - * @param element_info array containing element information from db; - * at least 'id', 'path', 'has_high' should be present - */ -function get_high_url($element_info) -{ - $url = get_high_location($element_info); - if (!empty($url) and !url_is_remote($url) ) - { - $url = embellish_url(get_root_url().$url); - } - // plugins want another url ? - return trigger_event('get_high_url', $url, $element_info); -} - -/** - * @param element_info array containing element information from db; - * at least 'id', 'path', 'has_high' should be present - */ -function get_high_location($element_info) -{ - $location = ''; - if ($element_info['has_high'] == 'true') - { - $pi = pathinfo($element_info['path']); - $location=$pi['dirname'].'/pwg_high/'.$pi['basename']; - } - return trigger_event( 'get_high_location', $location, $element_info); -} - - - -/* * get slideshow default params into array * * @param void @@ -173,61 +127,4 @@ function encode_slideshow_params($decode_params = array()) return $result; } - -// The get_picture_size function return an array containing : -// - $picture_size[0] : final width -// - $picture_size[1] : final height -// The final dimensions are calculated thanks to the original dimensions and -// the maximum dimensions given in parameters. get_picture_size respects -// the width/height ratio -function get_picture_size( $original_width, $original_height, - $max_width, $max_height ) -{ - $width = $original_width; - $height = $original_height; - $is_original_size = true; - - if ( $max_width != "" ) - { - if ( $original_width > $max_width ) - { - $width = $max_width; - $height = floor( ( $width * $original_height ) / $original_width ); - } - } - if ( $max_height != "" ) - { - if ( $original_height > $max_height ) - { - $height = $max_height; - $width = floor( ( $height * $original_width ) / $original_height ); - $is_original_size = false; - } - } - if ( is_numeric( $max_width ) and is_numeric( $max_height ) - and $max_width != 0 and $max_height != 0 ) - { - $ratioWidth = $original_width / $max_width; - $ratioHeight = $original_height / $max_height; - if ( ( $ratioWidth > 1 ) or ( $ratioHeight > 1 ) ) - { - if ( $ratioWidth < $ratioHeight ) - { - $width = floor( $original_width / $ratioHeight ); - $height = $max_height; - } - else - { - $width = $max_width; - $height = floor( $original_height / $ratioWidth ); - } - $is_original_size = false; - } - } - $picture_size = array(); - $picture_size[0] = $width; - $picture_size[1] = $height; - return $picture_size; -} - ?>
\ No newline at end of file |