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

Mikko Koppanen's Blog:
Fill patterns
April 29, 2008 @ 15:24:50

Mikko Koppanen has a quick post today showing how to use PHP and Imagick to create an image of text filled with another image layer behind it:

The fill pattern is used to annotate text but the named pattern could also be used to fill any shapes that allow fill to be specified (include circles, ellipses, rectangles, polygons etc etc).

His example is pretty simple (with a "Hello World!" output) that pulls in the background image, creates the composite layer over it, adds the text to it and sets the fill to the background image's layer. The whole this is wrapped up and output as a PNG file.

0 comments voice your opinion now!
fill pattern imagick tutorial example png background image


DevShed:
Creating Image Streams from Existing Graphics with the GD Library in PHP
August 20, 2007 @ 11:04:00

DevShed continues its look at using the GD graphics library in PHP with the second part of the tutorial series, this time focusing on the creation of images from existing images (and their streams).

As I stated at the end of the previous article of this series, the GD extension comes packaged with many other useful functions, which indeed deserve a close and detailed look. Thus, in this second tutorial I'll show you how to create different types of image streams from existing graphics, but in this case limiting the process to building GIF, JPG and PNG images.

They work through each of the types (GIF, JPG and PNG) creating an new one from a previous "clouds" image of the same type (a GIF out of a GIF, a JPG from a JPG, etc).

0 comments voice your opinion now!
tutorial gd graphic create stream png jpg gif existing tutorial gd graphic create stream png jpg gif existing


Stoyan Stefanov's Blog:
CSS Sprites generation tool
June 27, 2007 @ 10:29:00

In his latest post, Stoyan Stefanov introduces a new project he's working on, the implementation of CSS sprites:

This is a simple technique used for page load performance purposes. Since HTTP requests are the most expensive thing you can do in regards to front-end performance, you strive for making as little requests as possible. So instead of having the browser download 4 rounded corner images for example, you create one image that has all four. Then you use CSS' background-position to only show the part of the image you want.

He explains briefly how the system works and includes a simple example in PHP (showing how to use the imagemagik utility to create the custom image).

2 comments voice your opinion now!
css sprite generate png image implement css sprite generate png image implement


Secunia.com:
PHP "gdPngReadData()" Truncated PNG Data Denial of Service
May 22, 2007 @ 11:09:00

Secunia has posted this new advisory today about an issue with the GD graphics library functionality in PHP that could be used to cause a Denial of Service via a truncated PNG image.

The vulnerability is caused due to the incorrect use of libpng within the function "gdPngReadData()" in ext/gd/libgd/gd_png.c of the GD extension when processing truncated data. This can be exploited to cause an infinite loop by e.g. tricking an application to process a specially crafted file. (reported by Xavier Roche)

This issue has been confirmed in PHP versions 4.4.7 and 5.2.2 but may affect others. The issue has already been corrected, however, and can be fetched from the PHP CVS system to protect your system.

0 comments voice your opinion now!
gd image png truncate denialofservice secunia gdpngreaddata gd image png truncate denialofservice secunia gdpngreaddata


Richard Davey's Blog:
Easy Reflections
October 25, 2006 @ 16:34:00

On his blog today, Richard Davey shares a bit of code that will take an image and make a "nicely formatted reflection" of it automatically.

You can use it to give your site that 'iTunes / Apple' look if you so desire. I created it to make image uploads to a site I run look that little bit nicer, so figured I would share it with you all.

The script, Easy Reflections, can be grabbed from here along with the installation and use instructions (including the values for the six parameters to change the image).

0 comments voice your opinion now!
easy reflections functionality image relfect gif jpeg png download easy reflections functionality image relfect gif jpeg png download


AddedBytes.com:
Regular Expressions Cheat Sheet
September 15, 2006 @ 07:46:23

One of the more elusive concepts of programming can be working with regular expressions. Now, there's lots of places to learn them and to get a handle on what they can do (such as this book), but what if you don't need the full-blown reference and just want a quick and dirty reference source? AddedBytes.com is happy to be of service with their latest cheat sheet divided up into the different formats (anchors, character classes, assertions, escape characters, etc).

The Regular Expressions cheat sheet is designed to be printed on an A4 sheet of paper and live by a designer or developer's desk, to make life a bit easier. A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size Regular Expressions cheat sheet.

This time, they've posted it in a few different formats, including a torrent file to make for faster/easier download. They still have the usual methods (PDF and PNG) but you'll need to visit the page for those links - it's been requested not to directly link to them.

0 comments voice your opinion now!
cheat sheet regular expression pdf png torrent cheat sheet regular expression pdf png torrent


Zend Developer Zone:
Cool Image Thumbnail Class
August 30, 2006 @ 07:41:58

On the Zend Developer Zone, they point out a handy little image manipulation class they've come across - GenXDesign's PHP Thumbnail Class - as well as some details about it.

I've seen a lot of implementations of thumb nail functionality in PHP, I've even written a couple of my own. I like this class thought. In looking over the code the first thing you notice is that it's clean code. I don't mean they use the latest whiz-bang method to cshave a few keystrokes.

This code is simple, nicely formatted and easy to read through. My only real problem with the code itself is that it is not terribly well documented. That can be forgiven since easy to read.

Cal talks about some of the other features of the class, including that it works with gif/jpeg/png images, makes it easy to set the quality of the jpgs, and makes it easy to display the dynamic images directly to the browser. Check out the demo for more.

0 comments voice your opinion now!
image thumbnail class genxdesign gif jpeg png quality resize image thumbnail class genxdesign gif jpeg png quality resize


Codewalkers.com:
Creating a CAPTCHA with PHP
June 07, 2006 @ 05:58:57

Codewalkers.com has a new tutorial posted today showing the creation of a CAPTCHA image with PHP.

You may be thinking just exactly what is a captcha? Well you are likely to have already seen them across the web. They are those little images with a code on the front that you type into a box in order to submit something. This kind of system helps to prevent automatic submitting of an operation by some kind of program or robot. In this tutorial I will show you how to make a CAPTCHA [just like the one below]. Its not the most advanced captcha available because it uses a simple system font and nothing more.

They start with a look at how CAPTCHAs work before even looking at the code. The next steps include the creation of the random string of characters and placing them in the image (with a standard background in this case). The image is built with the GD functionality in PHP. Finally, they add the functionality in, checking a session variable, to ensure that the user has inputted the text from the image correctly.

1 comment voice your opinion now!
captcha tutorial image gd session png captcha tutorial image gd session png


CodedFX.com:
Creating a CAPTCHA for Your Site
April 04, 2006 @ 13:02:51

Via a pointer from the Zend Developer Zone, there's a new bit of code over on CodedFX.com to help you generate a CAPTCHA image to prevent spam messages from bots in your comments.

There's two files in his example - the main PHP that does the work and a font file to pull the text from. The code is pretty straight-forward, and can almost be cut and paste into any kind of application. Working with the font file is a little tricky, but GD has built-in functionality to work with it.

The script allows for any kind of true-type font input, multiple color schemes, transparency, and the ability to angle the letters to make them harder to interpret. The resulting output from his script is a PNG image, but with a few modifications, it could create JPEGs as well.

0 comments voice your opinion now!
create captcha image spam prevent GD PNG create captcha image spam prevent GD PNG


ASys DataService's Blog:
Rounded corners using PHP and the GD library
January 25, 2006 @ 13:01:50

On ASys DataService's blog, there's an article posted about creating rounded corners on your images with a little help from the PHP GD libraries.

I needed to add rounded corners to some pictures and didn't want to modify the source files in Photoshop (I think it's a bad idea to modify original pictures if the effect can be added dynamically).

That's when I decided to use the GD library, which I had found very useful in other projects. I'm not saying that this solution is perfect or better that others, but it has worked very well for me, and I hope it will be useful to some of you as well. Feel free to contact me if you have any comment about this code.

He briefly describes the code, noting where you can make config changes based on your needs. After that, it's all code, a procedural script that takes in any file and spits back out a custom rounded-corners image with your chosen settings. He even gives a PNG file of the rounded corner to use...

3 comments voice your opinion now!
rounded corners GD library png image rotate rounded corners GD library png image rotate



Community Events





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


opinion bugfix podcast symfony package tips language series introduction laravel interview framework list install api voicesoftheelephpant release library deployment community

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