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

File:
1 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                } 
Note: See TracChangeset for help on using the changeset viewer.