 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
PHPMaster.com: Extract Objects from an Access Database with PHP, Part 2
by Chris Cornutt June 03, 2013 @ 10:37:24
PHPMaster.com has posted the second part of their series covering connecting PHP to a legacy Access database. In part one they introduced you to working with the data and how to extract the object. In this new part they look at specific file types and how to pull out their data.
In this second part we'll learn how to extract Acrobat PDF documents and take a brief look at a selection of image formats. The only similarity that PDF, GIF, PNG, etc., have when stored in an Access database is that they are all wrapped in an OLE container consisting of a variable length header and trailer. As we shall see, the trailer can be ignored as it was with the package discussed in Part 1. The header is more useful, but doesn't contain all the information we need.
They get into the details of the headers for each type of object and include screenshots of what they look like in a hex viewer. The code for the complete class is included in the post, making it easy to drop in and get started with your transition from database object to external file.
voice your opinion now!
extract object access database tutorial series pdf image
PHPMaster.com: Crop and Resize Images with ImageMagick
by Chris Cornutt May 02, 2013 @ 12:14:51
PHPMaster.com has a new tutorial posted showing you how to crop and resize images with the help of the ImageMagick functionality that can be added to PHP (via this extension).
If your website allows users to upload photos, image cropping/resizing functionality certainly comes in handy. But users might not have access to image manipulation tools like Photoshop, so by providing a cropping/resizing feature you can allow users to upload photos from any device (e.g. tablets or phones) without them having to worry about the the final size. Furthermore, you can create different versions of the same image and also allow users to crop specific portions of uploaded picture. In this article I'll show you how to create an image cropping tool with the help of the ImageMagick PHP extension.
The post shows the use of the "cropimage" function to trim down an image from its original size and "thumbnailImage" to shrink down the image to make a thumbnail. Also included is the code (both the PHP and the HTML form) to handle file uploads and automatically create a thumbnail image. It outputs the image to the browser and asks the user to select the portion they want thumbnailed (with this jQuery plugin helping).
voice your opinion now!
crop image imagemagick tutorial resize extension
NetTuts.com: Create Instagram Filters With PHP
by Chris Cornutt March 26, 2012 @ 10:07:37
On NetTuts.com there's a new tutorial showing how you can create Instagram-like filters in PHP using the ImageMagick library/extension.
PHP comes bundled with GD (GIF Draw/Graphics Draw), which is a library for the dynamic creation of images. It can be used for simpler image operation, such as resizing, cropping, adding watermarks, creating thumbnails (Jeffrey wrote about it), applying basic photo filters - you've probably used it before. Unfortunately, if you want to create something more complex with GD, like Instagram effects, you can't. Luckily, though, we have ImageMagick!
He starts off by comparing the two graphics libraries and talks briefly about how to downliad and install Imagemagick on your development platform. Included is a PHP class to help you use it, coming complete with functions for changing the color tone of the image, adding a border and adding a vignette to the image. Also included are some "presets" represented in a few simple functions:
- Gotham
- Toaster
- Nashville
- Lomo
- Kelvin
There's also a few links to other resources you can use to find out more details on what Imagemagick has to offer.
voice your opinion now!
instagraph photo imagemagick filter tutorial image
PHPMaster.com: Watermarking Images
by Chris Cornutt 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.
voice your opinion now!
watermark image tutorial superimpose
DZone.com: Creating a virtual server with Vagrant a practical walkthrough
by Chris Cornutt November 18, 2011 @ 08:18:45
On DZone.com there's a new post from Giorgio Sironi looking at how to automate a build of a virtual server with Vagrant, setting up a LAMP-based development instance.
Vagrant ia a tool for building virtual machines (in VirtualBox's format) that conforms to a specification. It's written in Ruby, but it makes really no assumptions over the environments that you're gonna build; in this article, we will setup a virtual server for PHP applications running inside Apache.
The end result is a virtual machine based on VirtualBox images and can be built in a few easy steps:
- install the vagrant gems on the build system
- add a new virtual box instance pointed to a .box file
- create the Vagrant config (including the commands to run post-create)
- set up a little port forawrding
- creating a phpinfo file and starting up Apache
One suggested place for grabbing images (some with pre-defined software) is Bitnami's "Stacks" repository.
voice your opinion now!
vagrant ruby gem install tutorial virtualbox image build
Martin Psinas' Blog: Watermarking with text and ImageMagick
by Chris Cornutt 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.
voice your opinion now!
watermark text image tutorial imagemagick emboss
PHPMaster.com: From Zero to Cloud Setting up an EC2 Sandbox, Part 3
by Chris Cornutt September 22, 2011 @ 08:42:22
SitePoint's PHPMaster has a new post today, the third part of a series helping you get your application from "zero to cloud" on an Amazon EC2 setup. In this latest post they wrap things up by showing how to set up the full lamp stack on the remote server. Here's part one and two that lead up to this latest part.
This is the final article in a three part series focused on setting up EC2 as a sandbox for application developers. I assume you have an AWS account with Amazon; if you don't, please read Part 1 to learn how easy it is to sign up. I also assume you have configured your development environment and installed an AMI; if you haven't, please read Part 2. In this installment, we'll learn how to install Apache, MySQL and PHP in our running AMI, and then clone the AMI to make our own.
Included in the post are all the commands you'll need to get the packages installed for PHP, MySQL, Apache 2, PEAR and the PHP command line binary. With all of that installed, they show you how to create an AMI (Amazon Machine Image) to make it easier to scale in the future.
voice your opinion now!
tutorial amazon aws image machine scale ec2 instance
|
Community Events
Don't see your event here? Let us know!
|