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.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-26-2005, 05:27 AM   #1
bangman
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
bangman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-26-2005, 05:28 AM   #2
Nathan
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
Nathan is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-26-2005, 05:34 AM   #3
bangman
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
bangman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-26-2005, 05:35 AM   #4
bangman
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
bangman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-26-2005, 05:39 AM   #5
bangman
Confirmed User
 
Join Date: Sep 2004
Location: PA, USA
Posts: 5,283
Nevermind...i'm just an idiot.
__________________
- David Hall
ICQ: 312744199
bangman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.