CodeCanyon

ImageResize

  • 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
CodeCanopy says

nice work

Posted 2 years ago
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
adamh says
Author

Glad you like it. Any suggestions, let me know

Posted 2 years ago
  • Has been a member for 3-4 years
  • Bought between 10 and 49 items
salamfall says

How can I integrate this in a php MVC artchitecture /news/article/article_name

Posted 2 years ago
Author
Default-user adamh replied

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?

Posted 2 years ago
  • Has been a member for 3-4 years
  • Bought between 100 and 499 items
dirty_den says
Purchased

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

Posted 2 years ago
Author
Default-user adamh replied

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.

Posted 2 years ago
  • Has been a member for 3-4 years
  • Bought between 100 and 499 items
dirty_den says
Purchased

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.

Posted 2 years ago
Author
Default-user adamh replied

I didn’t hear back from you – assuming the script is working ok? Let me know if not

Posted 2 years ago
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
adamh says
Author

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?

Posted 2 years ago
  • Has been a member for 3-4 years
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
argosmedia says

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?

Posted 2 years ago
Author
Default-user adamh replied

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.

Posted 2 years ago
  • Has been a member for 3-4 years
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
argosmedia says

Oh I’m sorry, you’re right. I think I didn’t check well the first time…

Posted 2 years ago
  • Has been a member for 2-3 years
  • Bought between 1 and 9 items
  • France
dgoujard says

Script need GD and ImageMagic for transparency ?

Posted 2 years ago
Author
Default-user adamh replied

Just GD

Posted 2 years ago
  • Has been a member for 2-3 years
  • Bought between 1 and 9 items
  • France
dgoujard says
Purchased

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….

Posted 2 years ago
Author
Default-user adamh replied

I’ve added a new version of the script which fixes the png transparency issues – it’ll be up as soon as ThemeForest approve it.

It also fixes any quality issue. Sorry for the inconvenience.

Posted 2 years ago
Purchased
Default-user dgoujard replied

Thank you very mutch :)

Posted 2 years ago
Purchased
Default-user dgoujard replied

And work :) thank you very mutch

Posted 2 years ago
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
adamh says
Author

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.

Posted 2 years ago
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
adamh says
Author

Glad to see people using the script – does anyone have any feature requests? Thinking about what to add to the next version.

Posted 2 years ago
  • Has been a member for 2-3 years
  • Bought between 10 and 49 items
ryan44 says
Purchased

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?

Posted 2 years ago
Author
Default-user adamh replied

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

Posted 2 years ago
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 10 and 49 items
  • Netherlands
johanhendrix says

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!

Posted 2 years ago
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 10 and 49 items
jomark says

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.

Posted 2 years ago
Author
Default-user adamh replied

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.

Posted 2 years ago
  • Has been a member for 3-4 years
  • Exclusive Author
  • Bought between 100 and 499 items
  • Canada
xemmex says

I see that is it PHP 4x compatible, but does it work with PHP5 ?

Posted 2 years ago
Author
Default-user adamh replied

It does work in PHP5 – I believe the php compatibility on CodeCanyon is “the stated version and up”

Posted 2 years ago
  • Has been a member for 1-2 years
  • Bought between 1 and 9 items
darix88 says

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:

Posted 1 year ago
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
adamh says
Author

@Darix – that’s a problem with your ImageProcessor script. ImageResize doesn’t do rotation.

Posted 11 months ago
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 1 and 9 items
  • India
hmvrulz says

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

Posted 11 months ago
  • Has been a member for 3-4 years
  • Bought between 10 and 49 items
  • United States
jwerre says

Great work. On fix: the correct contraction for “does not” is doesn’t not “does’nt” on line 786

Posted 9 months ago

You must sign in or sign up to purchase this item.

$6Regular Licence

$6

Regular Licence a website (commercial, personal, client), or intranet site project - Details

67 Purchases 20 Comments

Buyer Rating
12345 ( 14 ratings )
no-thumbnail

adamh

  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 100 and 1 000 dollars
View Portfolio
Created 19 September 09
Compatible Browsers FireFox 2, FireFox 3, IE6, IE7, IE8, Safari
Software Version PHP 4.x
Software Framework N/A
Files Included PHP
by
by
by
by
by