Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

PHP & OOP - Image_Thumbnails

Links for php scripts

Moderators: macek, egami, gesf

PHP & OOP - Image_Thumbnails

Postby Oleg Butuzov » Thu Sep 04, 2003 1:06 am

I have write a small class for creating Thumbnails. I hope its will help somebody.

Any quetions in blog please. I am sorry but didnt yet translate my blog to english =(. I hope this litlle troubles would disturb you....=)
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby pootergeist » Thu Sep 04, 2003 3:24 am

I think you should set the compression/quality as a variable (maybe even one passed to the constructor) as 60% is not going to be acceptable to most designers. For a static value I'd reccommend 85% or even 90

I also have a thumbnailing class being distributed from most of the class distro sites and from here.

Also note: rather than the mime_content_tyep and imagesx / imagesy calls, you could use getimagesize - the first index return is width, second is height and third is imagetype


Code: Select all
$f_type = getimagesize($base_image);
$this->c_image = ($f_type[2] < 4)
                        ? ($f_type[2] < 3)
                            ? ($f_type[2] < 2)
                                ? ($f_type[2] < 1) ?
                            : imagecreatefromgif($base_image)
                        : imagecreatefromjpeg($base_image)
                    : imagecreatefrompng($base_image)
                    : NULL;
if($this->c_image !== NULL)
    // $f_type[0] is width
    // $f_type[1] is height
New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK

Postby Redcircle » Fri Sep 05, 2003 3:28 pm

link is not working
User avatar
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby sigix » Fri Sep 05, 2003 10:35 pm

:arrow: link is working ...
php-forum Active User
php-forum Active User
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion

Postby Oleg Butuzov » Sat Sep 06, 2003 12:19 am

permanent link

as for get image type by getimagesize function. I prefer to use mime_content_type() =)
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.