New: Add patch from meos to resize images

This commit is contained in:
Laurent Destailleur
2010-02-21 01:45:58 +00:00
parent 8e675a9c01
commit ae3cfce7cc
18 changed files with 1746 additions and 54 deletions

View File

@@ -25,6 +25,29 @@
*/
/**
* \brief Return size of image file on disk
* \param $file Full path name of file
* \return Array array('width'=>width, 'height'=>height)
*/
function dol_getImageSize($file)
{
require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
$ret=array();
if (image_format_supported($file) < 0) return $ret;
$fichier = realpath($file); // Chemin canonique absolu de l'image
$dir = dirname($file); // Chemin du dossier contenant l'image
$infoImg = getimagesize($fichier); // Recuperation des infos de l'image
$ret['width']=$infoImg[0]; // Largeur de l'image
$ret['height']=$infoImg[1]; // Hauteur de l'image
return $ret;
}
/**
* \brief Create a thumbnail from an image file (une small et un mini)