O'Reilly logo

jQuery 1.3 with PHP by Kae Verens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Caching or saving the image

Image manipulation is a good thing, but it's useless if the effect is only temporary. We want to be able to manipulate the image for uses such as placing in a web page, using in a gallery, or as a profile image.

Again, there are multiple ways to do this. We could manipulate the original image, saving changes back to the image, but that's destructive. By repeatedly manipulating the same file, you risk (actually, it's much more certain than risk) losing information. For example, resizing something down, and then up, results in pixelated or blurred images. And cropping — well, once something is cropped, you can't recover the uncropped image.

The solution I'd recommend is to leave the original alone, and create a new image ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required