News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Building a Web App with Symfony 2 Finalizing
October 29, 2013 @ 11:49:01

On SitePoint's PHP blog they've posted the last part of their series about building a web application with the Symfony2 framework. In this latest part they cover a few more complex things you can do to add features to your application.

In Part 1 and Part 2 of this series, I have covered the basics of using Symfony 2 to develop a functioning web site. In this part of the tutorial, I will cover some more advanced techniques and finish the project with pagination, image watermarks and NativeQuery.

He uses the default image library to add the watermarks (GD) and adds in a new route to view the cover of the book with the watermark applied. He shows how to add simple pagination into the book listing page (via controller attributes) and the use of the NativeQuery Doctrine provides to do more complex queries.

0 comments voice your opinion now!
symfony2 application tutorial series pagination watermark nativequery

Link: http://www.sitepoint.com/building-web-app-symfony-2-finalizing/

PHPMaster.com:
Adding Text Watermarks with Imagick
December 31, 2012 @ 09:15:48

On PHPMaster.com there's a recent tutorial from Martin Psinas about how you can add text to an image with the help of Imagick, the image editing software that's available to PHP via an extension.

In a previous article, Timothy Boronczyk wrote about how to create watermarks with Imagick using an overlay image. In this article, I'll show you how to achieve a similar effect using plain text.

He takes a sample image (a headshot) and offers two versions of the same functionality - both the shell command (using "convert") and the PHP code that sets up the font to use, adds placement and pushes the result back out as a PNG. He also includes two other types of overlay - a font mask for a more see-through look and a tiled version, overlaying the text all over the image.

0 comments voice your opinion now!
watermark imagick tutorial text overlay mask tile


PHPMaster.com:
Watermarking Images
January 02, 2012 @ 12:43:44

PHPMaster.com has a recent tutorial showing how to use the built-in Imagick extension to watermark your images effectively. It talks about what makes a good watermark and how to superimpose one on your images with a bit of sample code.

Imagine a friend of yours approaches you one day and would like you to build her a website so she can showcase her photography. She wants to be able to easily upload her photographs and have them watermarked so that people can't easily steal them. "Don't worry!" you tell her, because you know there are functions provided by the Imagick extension that makes watermarking images a breeze in PHP.

He talks about things like watermark transparency, the size of it (how much of the image you want it to cover) and the contrast of the watermark image to make it stand out from the image enough to be useful. Their example image and script puts the PHPMaster.com logo over the center of the image and includes a bit of code showing how to scale the watermark image to fit the image (this versus this.

0 comments voice your opinion now!
watermark image tutorial superimpose


Martin Psinas' Blog:
Watermarking with text and ImageMagick
October 04, 2011 @ 11:44:35

Martin Psinas has submitted a new tutorial he's written up (complete with sample code) showing how to watermark an image with ImageMagick.

In my most recent venture with PHPMaster I was asked to write an article about watermarking images with PHP using ImageMagick. Virtually no documentation exists on the PHP API, although there are plenty of command-line examples from the official ImageMagick website. I spent a solid day and a half attempting to convert command-line code into PHP before (due to miscommunication) the topic was covered by someone else and my work was no longer needed. Although disappointed, it gave me something to blog about! Yay.

His script is pretty straight forward - it loads a sample image, sets up some watermark text and applies it with a "gravity" setting of "southwest" and adds it to the image (annotateImage). The output is pushed back out as a JPEG image. Also included is a slightly more complex example showing how to give the watermark an embossed look and a "text all over the image" look to prevent use of any part of the image, not just one section.

0 comments voice your opinion now!
watermark text image tutorial imagemagick emboss


Script-Tutorials.com:
Watermark processing on images using PHP and GD
September 09, 2011 @ 12:36:06

On the Script-Tutorials blog today there's a new tutorial posted showing you how to easily add watermarks to your images dynamically, either as a part of a cache generation or on upload.

I will show you how to use GD library. And, main task today is adding watermark to image and generate result as PNG image into browser. We will using PHP and GD library. This is nice library to work with images at server side. Also (as additional tasks) I will draw little frame over image and will draw some text. Between, you can use this method (of adding watermarks in realtime) to protect original photos.

Full code for the script is included in the post, showing the combining of two images into the one finished product. The code is also available for download if you'd like to get hacking right away.

0 comments voice your opinion now!
watermark image gd combine tutorial


Gonzalo Ayuso's Blog:
Watermarks in our images with PHP and Gearman
March 07, 2011 @ 12:12:17

Gonzalo Ayuso had previously shown how to dynamically add watermarks to your images with the help of a mod_rewrite rule. One of the side effects of this is that, with a high load on your server, things can get bogged down quite quickly. His alternative? Add the watermarks to your images with Gearman workers.

In this second solution I will use a gearman worker to generate the watermarks. The benefits of gearman is the possibility of use a pool of workers. We can add/remove workers if our application scales. Those workers can be placed even at different hosts, and we can swap easily from one configuration to another.

He includes some sample scripts to illustrate the process - a Gearman client that'll call the watermarking process and a worker that takes in the image and transforms it with GD to add a new layer for the watermark.

0 comments voice your opinion now!
watermark image tutorial gearman worker client


Gonzalo Ayuso's Blog:
Watermarks in our images with PHP and mod_rewrite
March 01, 2011 @ 08:36:21

Gonzalo Ayuso has a new tutorial posted to his site today showing how to use mod_rewrite and a little bit of PHP magic to watermark images without having to apply it to each one manually.

he idea is simple. Instead of opening directly the image, we are going to open a PHP script. This PHP script will open the original image file with imagecreatefromjpeg, add the footer and flush the new image to the browser with the properly headers.

Since it would be a lot of trouble (especially on a larger site) to have to rewrite all of the <img> tags to point to this new PHP script for adding the watermark, he opts for the .htaccess instead. It catches and rewrites the request to the "watermark.php" file which pulls in that image, watermarks it and pushes the result back out.

0 comments voice your opinion now!
watermark tutorial imagecreatefromjpeg image dynamic


Mikko Koppanen's Blog:
Choosing watermark color based on the background luminosity
October 13, 2007 @ 16:04:00

Mikko Koppanen has another blog entry posted dealing with image manipulation with PHP and Imagick, this time it's a cool little script that lets you pick your watermark's color based on the image's background luminosity.

Usually images are watermarked using a predefined color (let's say for example "white"). How well does this actually work when you're doing the watermark on a light or even a white image? The answer is simple: not very well.

His example uses the ImagickPixelIterator to check the luminosity of the background and assigns the text a value between black and white according to the background. Complete code with usage and examples of the resulting images are included.

0 comments voice your opinion now!
imagick watermark color background luminosity imagick watermark color background luminosity


PHPit.net:
Image manipulation with PHP & the GD library (Part 2)
August 14, 2006 @ 13:39:51

New on PHPit.net today is part two of their series covering working with images in PHP through the GD graphics library.

In this second part of the "Image manipulation with PHP & the GD library" article series you will learn how to resize images, create thumbnails, watermark images and more.

They start with resizing images, showing how to grab the current size and alter it to modify the output (both in a set and proportional way). With that code in place, they take the next logical step - an automatic thumbnail creator from a file upload. Finally, they show how to help protect your images using a watermark - their example is a "Image by YourWebsite.com" string of text placed on the image.

0 comments voice your opinion now!
image manipulation part2 gd watermark thumbnail resize image manipulation part2 gd watermark thumbnail resize


DevShed:
Dynamic Watermarking with PHP
December 29, 2005 @ 06:38:53

From DevShed today, there's a new tutorial on using the built-in PHP image manipulation functionality (the GD libraries) to dynamically put watermarks on your images.

PHP features a wide array of functions for image handling and manipulation. In today's article, we are going to use those functions to create an image watermarking class. This class will operate on two images: a source image and a watermark. As an optional third parameter our class will also accept an alpha value '" allowing our watermark to contain alpha transparency.

They start off with a brief summary of what the functions are and how the script will work. From there, it's all source code and examples to get the script up and working. In the end, you'll have a script you can call from an img tag in HTML and it will generate the content for you automatically...

0 comments voice your opinion now!
dynamic watermark gd graphics dynamic watermark gd graphics



Community Events





Don't see your event here?
Let us know!


conference interview api bugfix threedevsandamaybe deployment release zendserver framework voicesoftheelephpant community laravel code symfony podcast language tips series introduction list

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework