473,587 Members | 2,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

is there a code to crop bottom border from an image ?

56 New Member
hi
is there a code to crop bottom border from an image when creating thumbnail for this image without crop the original image , but just crop 15px bottom border for creating the thumbnails for the image ?
Dec 13 '09 #1
3 3776
fuchsia555
56 New Member
here is creating thumbnail code it's fitting to the image , can we make it crop 15 pixel from the bottom , i mean can we make it fit the all width & the all heigh minus - 15 pixel ?

Expand|Select|Wrap|Line Numbers
  1. #create thumb
  2. $thumb = gd_fit($image,$settings['thumbxy']);
  3.  
Expand|Select|Wrap|Line Numbers
  1.     function gd_fit(&$image, $target) { 
  2.  
  3.         //takes the larger size of the width and height and applies the  
  4.         //formula accordingly...this is so this script will work  
  5.         //dynamically with any size image 
  6.  
  7.         $width = gd_width($image);
  8.         $height = gd_height($image);
  9.  
  10.         if ($width > $height) { 
  11.             $percentage = ($target / $width); 
  12.         } else { 
  13.             $percentage = ($target / $height); 
  14.         } 
  15.  
  16.         //gets the new value and applies the percentage, then rounds the value 
  17.         $width = round($width * $percentage); 
  18.         $height = round($height * $percentage); 
  19.  
  20.         //returns the new sizes in html image tag format...this is so you 
  21.         //can plug this function inside an image tag and just get the 
  22.  
  23.         return gd_resize($image,$width,$height);
  24.  
  25.     } 
Dec 13 '09 #2
carmarri
5 New Member
You can also use the funcion imagecopyresamp led() from the GD lib.

http://php.net/manual/en/function.im...yresampled.php

-------------------------------------
xatcom.net, diseño web
Dec 15 '09 #3
fuchsia555
56 New Member
Thanks for reply Dear Carmarri

Greetings
Dec 15 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
9466
by: Kevin Smith | last post by:
Is there a way to "auto-crop" an image in PIL? I have some PNG images with white backgrounds that I want cropped to show only the non-white portion in the center, but I don't see how I can do this. -- Kevin Smith Kevin.Smith@sas.com
2
2682
by: Michael Winter | last post by:
I have the familiar 'thumbnail' scenario. I want to place a small border around the image when the cursor hovers above it. I use a 1 pixel, solid border around the image that changes between normal and hover. This works fine in Internet Explorer, but in Opera 7.22, the bottom border is 3 pixels thick. If I expand all borders to 3 pixels,...
6
8603
by: John Salerno | last post by:
I might be way off target even looking into this method for what I need to do, but I'm still a little confused about the description of it: crop im.crop(box) => image Returns a rectangular region from the current image. The box is a 4-tuple defining the left, upper, right, and lower pixel coordinate. I'm probably just being a little...
1
2036
by: laurakr | last post by:
I am trying to use a clear to get my bottom nav bar below the quote box on the right, but it isn't working. I would like the bottom edge of the quote box to "stick" to the footer nav bar but copy to be able to flow to the left of the quote box. For the bonus round I would like the right edge of the box to align with the right edge of the...
3
2507
by: Paul | last post by:
I want the <div id="navigation"column to be the same color all the way to the bottom. The "background-image: url(bg_menu_tile.gif);" was a try to force it with a long 1-pixel graphic - didn't work. Any ideas? Here's the HTML: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html>...
1
2039
by: donpro | last post by:
https://testbed.odysseyshipping.com/index.php This is driving me nuts. I've spent much time trying to style this page footer but because I cannot set widths using "display: inline". I've tried using floats. Now, for some reason, I can't get my borders to display properly as it seems to nudge to the right for each level of my footer...
7
2486
by: praveenb000 | last post by:
Hi, every one on this forum.... I am new to web designing (using HTML/CSS). i designed a web page using HTML, Css with dream weaver. Here is the code i used for the desinging. it appears well in IE 6 browser but not in Mozilla 4.0 some components are disappears. This is the whole code i used for designing this page and i also given css...
2
3046
by: sateeshchandrasanga | last post by:
Hi All, My HTML code is working fine in Firefox.But its not displaying any thing in IE.Can you help me in this problem.And in Google crown its displaying but not properly. contactus.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
2
2064
by: everly | last post by:
Hi, I'm helping my friends band and making their MySpace. I messed something up and I can't figure out what it is. Everything is all out of whack on the bottom half of the page. The comments shouldn't be on the left hand side. Help please! Thanks. ____________________________________________________- <style type="text/css"> { Background...
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.