7
I did actually create a hack to handle image resizing - i added a function called XoopsMakeThumbnail() to the class/uploader.php file
A rough implementation of it would be this:
include_once XOOPS_ROOT_PATH . "/class/uploader.php";
$allowed_mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png');
$uploader = new XoopsMediaUploader($persdir, $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight);
if ($uploader->fetchMedia('foto')) {
if (!$uploader->XoopsMakeThumbnail()) {
$output_str .= $uploader->getErrors();
} else {
$foto = $uploader->savedFileName;
}
} else {
$output_str .= $uploader->getErrors();
}
My function calculates how much to resize the image so that it is reduced to either the maxwidth or maxheight. Then since I use imagemagick, I resize the image that way.
However, i never published the hack and wouldnt until it was streamlined with having more parameters (choosing GD, netpbm or imagemagick and their paths). And whoever was to use would need to know their way around xoops.
Alternatively, you could use the imanager or ibrowser plugins with a html editor module like TinyEditor - you can upload a photo and specify a number of different resizes to be made from it.