Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
for some reason I can't get any of PHP's image functions to work on my company's dedicated server. If someone who has had a headache with this could share my headache with me, it would be awesome. Here's my phpinfo()
I have gd installed and enabled, so I don't know what the deal is. Basically instead of shrinking images that the other site can shrink, it gives a broken image (or in firefox, says that the image has problems)
if gd wasnt properly installed You would get an error in php about some functions not beeing defined (for example with imagecreatefromjpeg function form the script bellow)
i spend a lot of time playing with shrinking script so if u want You cna see how i do it with my script that displays an image with it's path stored in mysql
as a parameter u give only the image number and the scripts gets the path from mysql table - after that it checks wether there is already a thumbnail-it there's not it generates it and saves it for future use.
$img = null; $ext = strtolower(end(explode('.', $image_path))); if ($ext == 'jpg' || $ext == 'jpeg') { $img = imagecreatefromjpeg($image_path); } else if ($ext == 'png') { $img = imagecreatefrompng($image_path); # Only if your version of GD includes GIF support } else if ($ext == 'gif') { $img = imagecreatefrompng($image_path); }
# If an image was successfully loaded, test the image for size if ($img) { # Get image size and scale ratio $width = imagesx($img); $height = imagesy($img); $scale = min(MAX_WIDTH/$width, MAX_HEIGHT/$height);
# If the image is larger than the max shrink it if ($scale < 1) { $new_width = floor($scale*$width); $new_height = floor($scale*$height);
# Create a new temporary image $tmp_img = imagecreatetruecolor($new_width, $new_height); //$tmp_img = imagecreate($new_width, $new_height); # Copy and resize old image into new image imagecopyresized($tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height); imagedestroy($img); $img = $tmp_img; } }
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.