1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
movim_ynh/sources/system/UtilsPicture.php
2015-08-19 11:28:28 +02:00

16 lines
516 B
PHP

<?php
function createEmailPic($jid, $email) {
if(file_exists(DOCUMENT_ROOT.'/cache/'.$jid.'_email.jpg'))
unlink(DOCUMENT_ROOT.'/cache/'.$jid.'_email.jpg');
$thumb = imagecreatetruecolor(250, 20);
$white = imagecolorallocate($thumb, 255, 255, 255);
imagefill($thumb, 0, 0, $white);
$text_color = imagecolorallocate ($thumb, 0, 0,0);//black text
imagestring ($thumb, 4, 0, 0, $email, $text_color);
imagejpeg($thumb, DOCUMENT_ROOT.'/cache/'.$jid.'_email.jpg', 95);
}