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