PHP Classes

PHP class to download, crop and resize images on the fly - PHP Image Crop and Resize package blog

Recommend this page to a friend!
  All package blogs All package blogs   PHP Image Crop and Resize PHP Image Crop and Resize   Blog PHP Image Crop and Resize package blog   RSS 1.0 feed RSS 2.0 feed   Blog PHP class to download...  
  Post a comment Post a comment   See comments See comments (0)   Trackbacks (0)  

Author:

Viewers: 431

Last month viewers: 9

Package: PHP Image Crop and Resize

This is a class that downloads, crops and resizes images on the fly based on some parameters from query string.




Loaded Article

I developed this code to satisfy my own needs some while ago and decided to make it available to the community.

In my case, I had some files stored on my own server which were big in size and I had to show the images with some fixed width or height on different pages. In that project I developed a code to do this for me.

Since I had the image_id of the images I had and they were all on my own server, I could have some url friendly options for this purpose.

For example if I wanted to change the width of an image to 200 pixels while keeping the aspect ratio, all I had to do was calling a url like this:

http://mysite/image-resize/al_23451/200

where al_23451 was the image id.

Since in general, the images are not on the same server, I modified the code to be able to download images from internet sources and because of that, I cannot have pretty urls here and I had to use parameters from the query string.

With this class, you can easily download images from all internet sources and store them on your server. It will create a folder with the name of the domain on which the image resides and with all the directory structure necessary. If you decide to resize the image, you can simply pass width and height as parameters in the query string.

It also supports watermarks and you can also convert the images to grey. The position of the watermark can also be defined.

You can find a complete documentation with the package as well.




You need to be a registered user or login to post a comment

1,613,085 PHP developers registered to the PHP Classes site.
Be One of Us!

Login Immediately with your account on:



Comments:

No comments were submitted yet.



  Post a comment Post a comment   See comments See comments (0)   Trackbacks (0)  
  All package blogs All package blogs   PHP Image Crop and Resize PHP Image Crop and Resize   Blog PHP Image Crop and Resize package blog   RSS 1.0 feed RSS 2.0 feed   Blog PHP class to download...