Редакция 524 | К новейшей редакции | Весь файл | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 524 | Редакция 525 | ||
---|---|---|---|
Строка 903... | Строка 903... | ||
903 | $path = $url["path"]; |
903 | $path = $url["path"]; |
904 | 904 | ||
905 | return 0; |
905 | return 0; |
906 | }
|
906 | }
|
907 | 907 | ||
908 | public function uploadPicture($path, $distributive, $datafile) { |
- | |
909 | $sPath = $this->secure->checkStr($path, 1); |
- | |
910 | $sDist = $this->secure->checkStr($distributive, 1); |
- | |
911 | - | ||
912 | $folder = $sPath.$sDist."-orig.png"; |
- | |
913 | $folderN = $sPath.$sDist.".png"; |
- | |
914 | $folderEM = $sPath.$sDist."-em.png"; |
- | |
915 | - | ||
916 | $distlogo = 0; |
- | |
917 | if (move_uploaded_file($datafile["distlogo"]["tmp_name"],$folder)) { |
- | |
918 | chmod($folder, 0644); |
- | |
919 | list($width, $height) = GetImageSize($folder); |
- | |
920 | $percent = 32/$height; |
- | |
921 | $newwidth = $width * $percent; |
- | |
922 | $newheight = $height * $percent; |
- | |
923 | - | ||
924 | $output = ImageCreateTrueColor($newwidth, $newheight); |
- | |
925 | $source = ImageCreateFromPNG($folder); |
- | |
926 | - | ||
927 | ImageCopyResampled($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
- | |
928 | ImagePNG($output, $folderEM); |
- | |
929 | - | ||
930 | $percent = 15/$height; |
- | |
931 | $newwidth = $width * $percent; |
- | |
932 | $newheight = $height * $percent; |
- | |
933 | - | ||
934 | $output = ImageCreateTrueColor($newwidth, $newheight); |
- | |
935 | - | ||
936 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
- | |
937 | ImagePNG($output, $folderN); |
- | |
938 | - | ||
939 | unlink($folder); |
- | |
940 | $distlogo = 1; |
- | |
941 | }
|
- | |
942 | - | ||
943 | return $distlogo; |
- | |
944 | }
|
- | |
945 | - | ||
946 | }
|
908 | }
|
947 | 909 | ||
948 | ?>
|
910 | ?>
|
949 | 911 |