here iam checking if the image size is in mb's than i want to reduce the image to kb's. iam not sure how to do this.
the if statment works fine. but i need halp inside.

$image = chunk_split(base64_encode(file_get_contents($_FILES['fileupload']['tmp_name'])));  //store image in database. long blob
if(strstr($file_size,'M')) //mb's
                {
                $upload_error .= "image is too big";

                $percent_resizing = 90;
                $new_width = round((($percent_resizing/100)*$image_width_height[0]));
            $new_height = round((($percent_resizing/100)*$image_width_height[1]));

            //$image = mysql_query("SELECT * FROM image WHERE user_id = $id ORDER BY image_id DESC");
            //$image = mysql_fetch_assoc($image); 
            //$image = $image['image'];
                $src = "data:image/gif;base64," . $image;
            echo "works <img src=\"$src\"  height='$new_height' width='new_width' class='image' />";
             //i dont want to print image here. i want to just change the size of image 
                        }
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.