![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Sep 2004
Location: PA, USA
Posts: 5,283
|
Who knows PHP & ImageMagick well?
I'm need a very minor thing changed in a php script.
It would take like 10 seconds for someone who knows PHP and ImageMagick, but I don't. If anyone feels like helping me, get me on ICQ or post here. Thanks.
__________________
- David Hall ICQ: 312744199 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 3,108
|
What do you need?
__________________
"Think about it a little more and you'll agree with me, because you're smart and I'm right." - Charlie Munger |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Sep 2004
Location: PA, USA
Posts: 5,283
|
I installed a simple gallery script into my WordPress, and everything works fine. I just want to change the way the ImageMagick thumbs the full-size pics.
In the script you can change the thumb size. Say I set it to 110x170 and the full-size pic is 600x200 - when you load it up, it thumbs the image to fit the height, not the width. I want it to fit the width. Make sense? ![]() Code:
generateImg($_GET['file'], $_GET['thumb']); function generateImg($img, $thumb) { global $gallery_root, $pictwidth, $pictheight, $thumbwidth, $thumbheight; if($thumb) { $height = $thumbheight; $width = $thumbwidth; } else { $height = $pictheight; $width = $pictwidth; } $img = $gallery_root.$img; $path = pathinfo($img); switch(strtolower($path["extension"])){ case "jpeg": case "jpg": Header("Content-type: image/jpeg"); $img=imagecreatefromjpeg($img); break; case "gif": Header("Content-type: image/gif"); $img=imagecreatefromgif($img); break; case "png": Header("Content-type: image/png"); $img=imagecreatefrompng($img); break; default: break; } $xratio = $width/(imagesx($img)); $yratio = $height/(imagesy($img)); if($xratio < 1 || $yratio < 1) { if($xratio < $yratio) $resized = imagecreatetruecolor($width,floor(imagesy($img)*$xratio)); else $resized = imagecreatetruecolor(floor(imagesx($img)*$yratio), $height); imagecopyresampled($resized, $img, 0, 0, 0, 0, imagesx($resized)+1,imagesy($resized)+1,imagesx($img),imagesy($img)); imagejpeg($resized); imagedestroy($resized); } else { imagejpeg($img); } imagedestroy($img); }
__________________
- David Hall ICQ: 312744199 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Sep 2004
Location: PA, USA
Posts: 5,283
|
The above code snippet is the php file that creates the thumbs.
__________________
- David Hall ICQ: 312744199 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Sep 2004
Location: PA, USA
Posts: 5,283
|
Nevermind...i'm just an idiot.
![]()
__________________
- David Hall ICQ: 312744199 |
![]() |
![]() ![]() ![]() ![]() ![]() |