Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Imagine: an image manipulation library in PHP 5.3

DZone's Guide to

Imagine: an image manipulation library in PHP 5.3

· Web Dev Zone ·
Free Resource

Learn how error monitoring with Sentry closes the gap between the product team and your customers. With Sentry, you can focus on what you do best: building and scaling software that makes your users’ lives better.

Want to work with images in PHP? and absorb some best practices while you're at it?

Check out Imagine, an "OOP library for image manipulation built in PHP 5.3".

PHP sometimes gets a bad rap for bad code -- maybe because lots of web developers wrote their first apps in PHP, and maybe old coding habits in an easy-to-use scripting language die hard.

Imagine, inspired by Python's PIL, hopes to show you just how well-constructed a PHP library can be.

The creator (avalanche123 on github) has documented everything extensively, from usage to API to defense of a few apparent quirks in the code.

Value objects in Imagine, for example, don't define any setter -- and here's why:

"Value objects - as you’ve noticed neither BoxInterface nor PointInterface along with their implementations define any setter. That means the state of those objects is immutable, so there aren’t side-effects to happen and the fact that they’re passed by reference, will not affect their values."


So for some solid code and good (and self-consciously OOP) explanatory tips for solid code construction -- or if you just want to manipulate some darn images! -- take a look at Imagine.

What’s the best way to boost the efficiency of your product team and ship with confidence? Check out this ebook to learn how Sentry's real-time error monitoring helps developers stay in their workflow to fix bugs before the user even knows there’s a problem.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}