Помощник
|
Наложение водяного знака |
ВэйДлин
|
Сообщение
#1
|
||
|
|
||
|
|||
Witu |
23.8.2010, 17:29;
Ответить: Witu
Сообщение
#2
|
|
http://www.google.ru/search?hl=ru&neww...q=&gs_rfai=
тебе в помощь :) |
|
|
Mulder_hb |
23.8.2010, 18:55;
Ответить: Mulder_hb
Сообщение
#3
|
|
Цена вопроса?
|
|
|
ВэйДлин
|
Сообщение
#4
|
|
http://www.google.ru/search?hl=ru&neww...q=&gs_rfai= тебе в помощь :) Мля я же Русским написал что долго искал у меня несколько мегабайт этих скриптов и все не то Цена вопроса? Еще лучше, буржуи пожаловали, а просто помочь нельзя?) м? P.S. Прошу вас не отвечать мне, я примерные ответы от таких людей знаю... Просто если у кого-нить завалялся скрипт прошу скинуть все остальное я сам сделаю. |
|
|
Flok |
23.8.2010, 21:37;
Ответить: Flok
Сообщение
#5
|
|
|
|
|
ВэйДлин
|
Сообщение
#6
|
|
Да я уже все перерыл, http://s61.radikal.ru/i174/1008/1c/2b8ce46e615b.png
Мне наверно уже на третьем форуме отвечают либо ссылкой на гугл либо просьбой заплатить. Я прошу если у кого есть проверенное решение дать мне его, ну почему другие не могут просто пройти мимо? |
|
|
Flok |
23.8.2010, 21:51;
Ответить: Flok
Сообщение
#7
|
|
ВэйДлин, да *** я ссылку дал, первая сверху - реализация ватермарка ТРЕМЯ способами. Что ещё не так?
|
|
|
LifeUP |
23.8.2010, 22:38;
Ответить: LifeUP
Сообщение
#8
|
|
вот класс которым я работаю с картинками:
[PHP] final class Image { private $file; private $image; private $info; public function __construct ($file) { if (file_exists ($file)) { $this->file = $file; $info = getimagesize ($file); $this->info = array( 'width' => $info[0], 'height' => $info[1], 'bits' => $info['bits'], 'mime' => $info['mime'] ); $this->image = $this->create ($file); } else { exit ('Error: Could not load image ' . $file . '!'); } } private function create ($image) { $mime = $this->info['mime']; if ($mime == 'image/gif'){ return imagecreatefromgif ($image); } elseif ($mime == 'image/png') { return imagecreatefrompng ($image); } elseif ($mime == 'image/jpeg') { return imagecreatefromjpeg ($image); } } public function save ($file, $quality = 80) { $info = pathinfo ($file); $extension = $info['extension']; if ($extension == ('jpeg' || 'jpg')) { imagejpeg ($this->image, $file, $quality); } elseif($extension == 'png') { imagepng ($this->image, $file, 0); } elseif($extension == 'gif') { imagegif ($this->image, $file); } imagedestroy ($this->image); } public function resize ($width = 0, $height = 0) { if (!$this->info['width'] || !$this->info['height']) { return; } $xpos = 0; $ypos = 0; $scale = min ($width / $this->info['width'], $height / $this->info['height']); if ($scale == 1) { return; } $new_width = (int)($this->info['width'] * $scale); $new_height = (int)($this->info['height'] * $scale); $xpos = (int)(($width - $new_width) / 2); $ypos = (int)(($height - $new_height) / 2); $image_old = $this->image; $this->image = imagecreatetruecolor ($width, $height); $background = imagecolorallocate ($this->image, 255, 255, 255); imagefilledrectangle ($this->image, 0, 0, $width, $height, $background); imagecopyresampled ($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']); imagedestroy ($image_old); $this->info['width'] = $width; $this->info['height'] = $height; } public function watermark ($file, $position = 'bottomright') { $watermark = $this->create($file); $watermark_width = imagesx($watermark); $watermark_height = imagesy($watermark); switch($position) { case 'topleft': $watermark_pos_x = 0; $watermark_pos_y = 0; break; case 'topright': $watermark_pos_x = $this->info['width'] - $watermark_width; $watermark_pos_y = 0; break; case 'bottomleft': $watermark_pos_x = 0; $watermark_pos_y = $this->info['height'] - $watermark_height; break; case 'bottomright': $watermark_pos_x = $this->info['width'] - $watermark_width; $watermark_pos_y = $this->info['height'] - $watermark_height; break; } imagecopy($this->image, $watermark, $watermark_pos_x, $watermark_pos_y, 0, 0, 120, 40); imagedestroy($watermark); } public function crop($top_x, $top_y, $bottom_x, $bottom_y) { $image_old = $this->image; $this->image = imagecreatetruecolor($bottom_x - $top_x, $bottom_y - $top_y); imagecopy($this->image, $image_old, 0, 0, $top_x, $top_y, $this->info['width'], $this->info['height']); imagedestroy($image_old); $this->info['width'] = $bottom_x - $top_x; $this->info['height'] = $bottom_y - $top_y; } public function rotate($degree, $color = 'FFFFFF') { $rgb = $this->html2rgb($color); $this->image = imagerotate($this->image, $degree, imagecolorallocate($this->image, $rgb[0], $rgb[1], $rgb[2])); $this->info['width'] = imagesx($this->image); $this->info['height'] = imagesy($this->image); } private function filter($filter) { imagefilter($this->image, $filter); } private function text($text, $x = 0, $y = 0, $size = 5, $color = '000000') { $rgb = $this->html2rgb($color); imagestring($this->image, $size, $x, $y, $text, imagecolorallocate($this->image, $rgb[0], $rgb[1], $rgb[2])); } private function merge($file, $x = 0, $y = 0, $opacity = 100) { $merge = $this->create($file); $merge_width = imagesx($image); $merge_height = imagesy($image); imagecopymerge($this->image, $merge, $x, $y, 0, 0, $merge_width, $merge_height, $opacity); } private function html2rgb($color) { if ($color[0] == '#') { $color = substr($color, 1); } if (strlen($color) == 6) { list($r, $g, $b) = array($color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5]); } elseif (strlen($color) == 3) { list($r, $g, $b) = array($color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2]); } else { return FALSE; } $r = hexdec($r); $g = hexdec($g); $b = hexdec($b); return array($r, $g, $b); } } [/PHP] принцип работы элементарен, думаю разберетесь |
|
|
Mulder_hb |
23.8.2010, 23:14;
Ответить: Mulder_hb
Сообщение
#9
|
|
|
Еще лучше, буржуи пожаловали, а просто помочь нельзя?) м? Такие заказы относятся к коммерческой наживе. Если вы собираетесь наживаться на водяных знаках (а иначе зачем ставить их), то извольте поделится с тем, кто их вам создаст. Иначе буржуем здесь выглядите вы, причем наглым жадным буржуем. А делиться я готов с теми, кто не собирается наживаться на моих скриптах за моей спиной. Ничего личного.
|
|
|
||
|
Текстовая версия | Сейчас: 28.3.2024, 12:55 |