mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-22 00:32:16 +02:00
N°3124 - Refactorize ResizeImageToFit methods (#734)
This commit is contained in:
@@ -433,9 +433,10 @@ class UserProfileBrickController extends BrickController
|
||||
$oCurContact = UserRights::GetContactObject();
|
||||
// Resizing image
|
||||
$oAttDef = MetaModel::GetAttributeDef(get_class($oCurContact), $sPictureAttCode);
|
||||
$aSize = utils::GetImageSize($oImage->GetData());
|
||||
$oImage = utils::ResizeImageToFit($oImage, $aSize[0], $aSize[1], $oAttDef->Get('storage_max_width'),
|
||||
$oAttDef->Get('storage_max_height'));
|
||||
$oImage = $oImage->ResizeImageToFit(
|
||||
$oAttDef->Get('storage_max_width'),
|
||||
$oAttDef->Get('storage_max_height')
|
||||
);
|
||||
// Setting it to the contact
|
||||
$oCurContact->Set($sPictureAttCode, $oImage);
|
||||
// Forcing allowed writing on the object if necessary.
|
||||
|
||||
Reference in New Issue
Block a user