freshizer - Custom WordPress Image Resizer with Cache


#1

Hey guys,

I just finished new resizing script for WordPress, which should work in 100% cases (not like timthumb where there are plenty of troubles with permission :slight_smile: )

You can find the script on github here:


Usage:
include 'freshizer.php';
// not fixed height
echo fImg::resize( 'http://domain.com/wp/image.jpg', 200, 200, false );
// fixed height
echo fImg::resize( 'http://domain.com/wp/image.jpg', 200, 200, true );

The last two (height and fixed) parameters are optional. This script goes with automated caching, so you will be not overloading your server. Also this script does not even connect to your database, yay :slight_smile:

All images are stored in:

/wp-content/uploads/freshizer/

Please note that you can only resize images saved in the same WordPress installation


#2

Great work mate, is it allowed to redistribute? :smiley:


#3
Manh said

Great work mate, is it allowed to redistribute? :smiley:

Yes, of course :slight_smile: But please keep it under the same name and with that license. It would also be nice if you credited us (freshface) as the script author somewhere, with a backlink to this thread or something, but I will leave that up to your discretion guys :wink:


#4
freshface said
Manh said

Great work mate, is it allowed to redistribute? :smiley:

Yes, of course :slight_smile: But please keep it under the same name and with that license. It would also be nice if you credited us (freshface) as the script author somewhere, with a backlink to this thread or something, but I will leave that up to your discretion guys :wink:

Yes of course, the author is always respected :slight_smile:

i’ll will try it in my next project :wink:


#5

Just a quick note, overseeing the code. Never use private statement, if you want to make this class expandable.

If somebody would want to use your class but doesn’t want to break update compatibility and extend your class, he may want to override some of your methods. But you can’t override private ones :slight_smile:

Better use protected. Doesn’t allow access from outside but makes it expandable.

Nice work, btw :wink:


#6

Looks great!

Look forward to trying this out, thanks :slight_smile:

  • Ed

#7
Bebel said

Just a quick note, overseeing the code. Never use private statement, if you want to make this class expandable.

If somebody would want to use your class but doesn’t want to break update compatibility and extend your class, he may want to override some of your methods. But you can’t override private ones :slight_smile:

Better use protected. Doesn’t allow access from outside but makes it expandable.

Nice work, btw :wink:

Thank you, I’m actually not so much experienced with programming in team. So I just declared all private methods as protected, then everyone can implement it own inherent class


#8

Can’t wait to test it :slight_smile:

wait, what’s your github username :shocked: :zipped:


#9
laranz said

Can’t wait to test it :slight_smile:

wait, what’s your github username :shocked: :zipped:

LOL Cool name! :slight_smile:

Great stuff BTW :smiley:


#10

Oh wow, thanks! I’ve been working on my own Timthumb alternative, which works, but I can’t say 100% that it will work for everyone. (but I really think it does). Now I come across your script… I think I’ll use your script since you seem more confident than me that it will work with 100% of users. :slight_smile: I won’t wait to use it on a new theme… instead I will upgrade an existing one.


#11

Thank you guys, feel free to use this script in your themes. Could you please test it at your demo servers for first and then let me know if it works ? It should be 100% bulletproof, because it’s using built-in WordPress functions to resize the images. But I want to have a proof, because I don’t want to be under pressure when you release theme and find a bug after that :slight_smile:

SCRIPT UPDATE

  • now you can resize all images hosted at your server, not only in wp directory :slight_smile:

  • consulting remote images with my programmer friends :slight_smile:


#12

Hi,

thanks for sharing. I’ll let you know if we experience any Issues. Currently we are developing a new theme, so I’ll be able to give you some feedback within the next few hours.

Cheers mate!


#13

oh that’s great!
we don’t have a “thanks” button or something like that here, no?
anyway I want to say thank you for sharing :slight_smile:


#14

Hi,

looks like the script return value contains the absolute server path to the image like /var/www/… , which apparently is causing the image not to display. Anyways the image re size itself works great. I’ll do some additional testing now.

Best Regards


#15

Hi!

fixed -> please re-download from github.

it was caused because I added support to resize image located in any dir, not just a wp dir


#16

Hi,

that was quick :wink: Works great now. I’ll let you know if I recognize any more issues. To be able to make use of images outside the wp-content dir makes this script “uber” :slight_smile:

Great Work!

Best Regards


#17

Good job Bosses! You rock! :slight_smile:


#18

how about crop, crop postion & zoom? any vulnerablilities?


#19
FlickapixDezign said

how about crop, crop postion & zoom? any vulnerablilities?

1.) cropping and zooming will be in one of the next releases

2.) it’s 100% secure:)


#20

so how exactly does this work? I don’t see any documentation in the download. Does it prevent wordpress from changing any images?