image_lib watermarking - view part - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: image_lib watermarking - view part (/showthread.php?tid=37196) Pages:
1
2
|
image_lib watermarking - view part - El Forum - 01-01-2011 [eluser]Casperlarsen94[/eluser] I'm trying to learn the codeigniter image libary, and i can't find anything about the view part in watermarking an image. Controller Code: $config['source_image'] = 'http://websplus.dk/images/layout/banner.png'; How should my view look like? I hope you guys can help me And happy new year image_lib watermarking - view part - El Forum - 01-09-2011 [eluser]Cristian Gilè[/eluser] Hi Casperlarsen94, in the view something like this: Code: <img src='path/to/your/watermarked/image' alt='my watermarked image' /> Cristian Gilè image_lib watermarking - view part - El Forum - 01-09-2011 [eluser]Casperlarsen94[/eluser] Is it possible to add my watermark to ONE image depending on the URL? For example, if the url www.example.com/banner/casperlarsen then the watermark text should be casperlarsen. Or if the url is www.example.com/banner/johndoe the text should be johndoe image_lib watermarking - view part - El Forum - 01-09-2011 [eluser]Nick_MyShuitings[/eluser] Since you are adding the watermark text in the controller... and since the controller has access to the name.... connect the dots and it should be possible image_lib watermarking - view part - El Forum - 01-09-2011 [eluser]Cristian Gilè[/eluser] Code: $config['source_image'] = 'http://websplus.dk/images/layout/banner.png'; Cristian Gilè image_lib watermarking - view part - El Forum - 01-09-2011 [eluser]Casperlarsen94[/eluser] I know how to get the name from URL in to a string. But i don't know how to pass there config and the watermark information to my view, and then create the image? image_lib watermarking - view part - El Forum - 01-09-2011 [eluser]Cristian Gilè[/eluser] The path of the image (source_image) must be a relative or absolute server path, not a URL. Cristian Gilè image_lib watermarking - view part - El Forum - 01-09-2011 [eluser]Casperlarsen94[/eluser] But how schould the view look like? I don't understand it, sorry. image_lib watermarking - view part - El Forum - 01-09-2011 [eluser]Cristian Gilè[/eluser] You have an image on your server and you have set its path in $config['source_image']. When you do Code: $this->image_lib->watermark(); the image has been watermarked. In your view, now, you can show the image with the img tag: Code: <img src='path/to/your/image' alt='my watermark image' /> If you need to restrict access to your images, read this Cristian Gilè image_lib watermarking - view part - El Forum - 01-09-2011 [eluser]Casperlarsen94[/eluser] This doesn't works? My Controller Code: class Test extends Controller My View Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |