Can any one help me how to resize images
in php with out changing its original quality,that is if an image with size 100/100 when it reduced to 40/30 or any our required dimensions with out changing its quality
.
nathenastle -1 Light Poster
Recommended Answers
Jump to PostOne more point...
By using our php codes..
Changing from 100X100 image to 40X50 image will result into same quality image...But vice versa will give corrupted image..So make it note when your are going develop in your projects..
Jump to PostHi, I have made a function that will resize images and is as follows:
<?php function resize_image($filename,$newwidth,$newheight) { if (!file_exists($filename) || !in_array(preg_replace('/(.*)[.]([^.]+)/is','$2',basename($filename)),array('png','jpg','jpeg','gif','xbm','xpm','wbmp'))) { //note .wbmp is 'wireless bitmap' and not 'windows bitmap'. return false; } else { $ext=preg_replace('/(.*)[.]([^.]+)/is','$2',basename($filename)); if ($ext=='jpg') { $ext='jpeg'; } $ext='imagecreatefrom'.$ext; list($width, $height) = …
Jump to PostI do not understand why we (the programmers) use unnecessary huge buggy codes of our own for resizing images??!! As we've phpThumb, custom image resizing functions are just a history. Then why do we manually write those codes again and make our script buggy!
Yes I know what I am …
All 9 Replies
BzzBee 5 Posting Whiz
BaburajSNS 0 Newbie Poster
Shanti C 106 Posting Virtuoso
nathenastle -1 Light Poster
BaburajSNS 0 Newbie Poster
cwarn23 387 Occupation: Genius Team Colleague Featured Poster
adnan3250 0 Newbie Poster
ShawnCplus 456 Code Monkey Team Colleague
red_ruewei 0 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.