Changeset 4505 for sandbox


Ignore:
Timestamp:
05/25/11 14:00:43 (13 years ago)
Author:
airton
Message:

Ticket #1930 - Problema no upload e sincronização de imagem de um contato do Expresso

Location:
sandbox/2.2.0.2/contactcenter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.2.0.2/contactcenter/inc/class.ui_data.inc.php

    r4502 r4505  
    29892989 
    29902990                        header('Content-type: image/jpeg'); 
     2991 
     2992                        $tmpDir = $GLOBALS['phpgw_info']['server']['temp_dir']; 
     2993                        $imagem_temp = fopen("$tmpDir/img_tmp","wb+"); 
     2994                        fwrite($imagem_temp,$contact['photo']); 
     2995                        fclose($imagem_temp);                    
     2996                        $exif = exif_read_data("$tmpDir/img_tmp","IDF0"); 
     2997                        $ort = 1; 
     2998                        if ($exif['Orientation'] != '') { 
     2999                                $ort = $exif['Orientation']; 
     3000                        } 
     3001                        unlink("$tmpDir/img_tmp");                       
     3002 
    29913003                        $photo = imagecreatefromstring ($contact['photo']); 
    29923004                        $width = imagesx($photo); 
     
    29963008                        $small_photo = imagecreatetruecolor ($twidth, $theight); 
    29973009                        imagecopyresampled($small_photo, $photo, 0, 0, 0, 0,$twidth, $theight, $width, $height); 
    2998                         imagejpeg($small_photo,"",100); 
     3010                         
     3011                        if ($ort != 1){ 
     3012                                switch($ort) 
     3013                                { 
     3014                                        case 3:  
     3015                                                $rotate = imagerotate($small_photo, 180, 0); 
     3016                                                break; 
     3017                                        case 6: 
     3018                                                $rotate = imagerotate($small_photo, 270, 0); 
     3019                                                break; 
     3020                                        case 8: 
     3021                                                $rotate = imagerotate($small_photo, 90, 0); 
     3022                                                break; 
     3023                                } 
     3024                        } else $rotate = imagerotate($small_photo, 0, 0); 
     3025         
     3026                        imagejpeg($rotate,"",100); 
     3027                        ImageDestroy($rotate); 
     3028                        ImageDestroy($small_photo); 
     3029 
    29993030                        return; 
    30003031                } 
  • sandbox/2.2.0.2/contactcenter/js/cc.js

    r4502 r4505  
    10491049                                if (data[i]) 
    10501050                                { 
     1051                                        //Codigo para exibicao da imagem do contato no IE 
     1052                                        //Douglas Lopes Gomes - Prognus Software Livre 
     1053                                        if (Element(i)[1] && Element(i)[1].src){ //Se o navegador éo IE  
     1054                                                Element(i)[1].src = data[i] + '&'+ Math.random(); 
     1055                                        } else { //Se o navegador não é o IE 
    10511056                                        Element(i).src =  data[i] + '&'+ Math.random(); 
     1057                                        } 
    10521058                                } 
    10531059                                break; 
Note: See TracChangeset for help on using the changeset viewer.