- Has been a member for 3-4 years
- Helped protect Envato Marketplaces against copyright violations
- Exclusive Author
- Sold between 1 000 and 5 000 dollars
- Bought between 50 and 99 items
- United Kingdom
- Referred between 1 and 9 users
nice work
nice work
Glad you like it. Any suggestions, let me know
How can I integrate this in a php MVC artchitecture /news/article/article_name
Doesnt seem to work for me
uploaded to windows server in a subfolder and get error ‘image cannot be found’ so I think ther may be a path script error for this server set up.
Also tried uploading on the same server to a site root as you suggest and still the same error using your sample files.
Can you suggest a code fix assume the error is caused around the define path lines in the php class?
We shouldnt need apache mod rewrite or the ht access for this to work, only for rewritten sef urls. Its doesnt say it is only for linux.
I prefered this script than the other similar one on here because of the cropping functionality.
Thanks
The script requires mod_rewrite only for friendly urls – mod_rewrite can be installed on windows/iis using a plugin such as Isapi Rewrite (www.isapirewrite.com).
The script can still be used without mod_rewrite, using query strings. Just put your source image in the source query string:
/path/to/resize.php?source=/path/to/image.jpg&width=100
I hope that helps – let me know either way.
Yes I have this ISAPI rewrite filter already installed but dont require the urls changing. I already did exactly as you said. the image is visible and pointing to the correct path previously. But when I add the suffix eg
&width=100 I get the error. Ill try it on another server tomorrow, Maybe it is a server path issue.
The problem is that the path to your image is wrong. Can you send me the link you’re using to resize as well as a link to the original image so I can try to debug?
What is the practical use of this script? It does not really resize pictures, it just visually resizes them. So big pics stay big, but they only appear smaller. This is effectively the same as good old height=”x” and width=”x” HTML parameters. I don’t understand the advantage of this script. Do I miss something?
It resizes images on the fly, so the image served to the browser is a smaller file size. If you use html width and height attributes, the full-sized file is served, resizing is done by the browser (badly and out of proportion) and your code won’t be valid xhtml.
The script can easily be updated to permanently save the resized images.
The script can also crop and stretch images as required.
Oh I’m sorry, you’re right. I think I didn’t check well the first time…
Script need GD and ImageMagic for transparency ?
Ok, i have buy this script but i need add in get quality=5 without quality i have error. And png without transparency !!! i have test with http://www.noelshack.com/up/aac/kevgil-angel-or-devil-tux-a77bc95f70.png and when i resize i have an black background… http://www.noelshack.com/up/aac/kevgil-angel-or-devil-tux_o-2a931f7f14.png
i have buy this script for transparency….
You can change the quality by adding quality=50 (or whatever). Default quality is 80.
I’ll have a look at the transparency issues and get back to you asap.
Glad to see people using the script – does anyone have any feature requests? Thinking about what to add to the next version.
I’m having a problem, the script resizes and crops great, but sometimes the images don’t load properly. i.e. if you refresh the page, some will display, refresh again, and none show.
Any ideas what’s causing this?
Hi Ryan
As ImageResize is server-side, the only thing I can think is that you (or your server) may be adding to or modifying the cache headers on the outputted image. Can you check to see if the problem affects the following image:
http://adamhopkinson.co.uk/classes/resize/images/spitfire.jpg?height=200
If not, please report back what browser you are using as well as what PHP version and GD version. You can get this by calling phpinfo().
Thanks, Adam
I would like to see an extra feature added which allows to set the crop to:
topleft, topcenter, topright, middleleft, middlecenter, middleright, bottomleft, bottomcenter, bottomright.
This wil come in very handy when using it for a gallery with headshots. Headshots often require a topcenter crop because otherwise the head will be cut off.
Cheers!
I am interested. But I’d like to know if can use it in lieu of timthumb and what are its advantages. My wordpress site is using timthumb but sometimes it does not load the image properly.
Having had a brief look at timthumb, I think ImageResize offers the same functionality set.
However, the fact that your images are not always loading may indicate a problem with your server (such as low resources). If this is the case, you might have the same issues with any image resize script.
I see that is it PHP 4x compatible, but does it work with PHP5 ?
nice script!
I got only one problem… When I rotate transparent picture – PNG to for example 29° I’ve got black background.
my code is:
$ImageProcessor = new ImageProcessor(); $ImageProcessor->Load(“images/slika.png”); $ImageProcessor->Rotate(29); $ImageProcessor->Parse(100);
and output is:

@Darix – that’s a problem with your ImageProcessor script. ImageResize doesn’t do rotation.
Can we use this script for the following ?
1. Resize and Crop 2. Rename the Image and change image type from anything to jpg. 3. Move it to a different folder
Great work. On fix: the correct contraction for “does not” is doesn’t not “does’nt” on line 786
COPYRIGHT © 2012 ENVATO| TERMS OF USAGE| SUPPORT/HELP| ICONS BY TANGO + WEFUNCTION + FAMFAMFAM
Adobe®, Flash®, Flex®, Fireworks®, Photoshop®, Illustrator®, InDesign® and After Effects® are registered trademarks of Adobe Systems Incorporated.
If you put the script in the root of your app (as per the instructions doc), you can resize any image within the root by adding query string parameters
eg path/to/image.jpg?width=100
If you want to have fully friendly urls for the resized images too, you could add a mod_rewrite rule so that you could refer to the image above as:
path/to/image.jpg/width/600/height/400
Does that answer your question?