hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : PHP Image Manipulation Question
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

PHP Image Manipulation Question

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-28-2007, 04:25 PM
SI-Chris SI-Chris is offline
Web Hosting Master
 
Join Date: Nov 2000
Location: USA
Posts: 1,269

PHP Image Manipulation Question


I have been searching Google and can't figure out how to do this. I have a thumbnail builder in PHP and there's one thing I want to add but am not sure how to do it. Perhaps someone here can give me a code example.

Say I created a thumbnail that's 100x50, and I want to add 25 pixels of white space at the top and bottom so the image is exactly 100x100. I don't know how to add the white space. I am using GD to generate the thumbnails.

Reply With Quote


Sponsored Links
  #2  
Old 08-28-2007, 04:39 PM
foobic foobic is offline
Community Liaison 2.0
 
Join Date: Feb 2005
Location: Australia
Posts: 5,118
I don't think GD has built-in commands to change the canvas size. I'd just create a new image 100x100 white background and insert your thumbnail into it at position (100-w)/2, (100-h)/2.

__________________
Chris

"Learn from the mistakes of others. You can never live long enough to make them all yourself." - Groucho Marx

Reply With Quote
  #3  
Old 08-28-2007, 05:42 PM
killapix killapix is offline
Junior Guru
 
Join Date: Feb 2006
Location: top: 50px; left: 200px;
Posts: 213
why not make the container the thumb displays in a certain size and color using css.?

#thumb_container{background: #FFF; padding: 25px 0 25px 0;}

<div class="thumb_container"><?php echo $my_thumb ?></div>

__________________
Filefeed.net - Image Hosting -

Reply With Quote
Sponsored Links
Reply

Related posts from TheWhir.com
Title Type Date Posted
Customer Feature: How EdgeCast Delivers One Billion Imgur Images Each Day Web Hosting News 2012-05-31 12:22:36
2012 WHIR Reader Survey Extended - take a few minutes to complete and win Blog 2012-04-30 11:14:58
Rackspace Blog Looks at Easy Outsourcing for App Development Blog 2012-03-05 19:07:48
A First Look at cPanel’s new User Interface Web Hosting News 2011-09-15 19:35:40
Web Host SoftLayer Launches Public Image Repository for Cloud Templates Web Hosting News 2011-06-08 14:56:19


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?