~rmwenyekheri/sarisiae/trunk

« back to all changes in this revision

Viewing changes to includess/logoformat1.php

  • Committer: NDIMBOJr
  • Date: 2015-08-13 10:09:13 UTC
  • Revision ID: rmwenyekheri@gmail.com-20150813100913-wa5o4k7vvarmzl4n
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
#resize logo
 
3
                $logo = 'images/logo.jpg';
 
4
                $logofile = '../'.$logo;
 
5
                #resize photo
 
6
                $full_url = $logo;                      
 
7
                $imageInfo = @getimagesize($logofile);
 
8
                $src_width = $imageInfo[0];
 
9
                $src_height = $imageInfo[1];
 
10
                
 
11
                $dest_width = 100;//$src_width / $divide;
 
12
                $dest_height = 90;//$src_height / $divide;
 
13
                
 
14
                $src_img = @imagecreatefromjpeg($logofile);
 
15
                $dst_img = imagecreatetruecolor($dest_width,$dest_height);
 
16
                @imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width, $dest_height, $src_width, $src_height);
 
17
                @imagejpeg($dst_img,$full_url);
 
18
                @imagedestroy($src_img);
 
19
        #new resized image file
 
20
        $logofile = $full_url;
 
21
        #NB: ili hii ifanye kazi lazima images folder kwenye academic liwe writable!!!
 
22
?>
 
 
b'\\ No newline at end of file'