|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi
Maybe I can get a hint from someone on this. What I have in mind is to create the thumbnail from gif or jpeg images that I have in directories. All the gif and jpeg images are of different sizes and shapes, that is not a problem as I can run a few tests and then assign a percentage to either the width or height variable. The problem is what to do with the rest of the space. What I mean by that is if say the original size was 500pix x 100pix and I want the thumb to be no more than 100pix, I can with no problem do that. But the thumb is only 20pix high now, there is a lot of empty space below it now. What I want to do is build a container that is 100pix by 100pix and put the thumb into it, centered is the ideal, but left and top isn't a problem. I think it has to do with transparent colors so that the image shows through. Thanks in advance Mike |
|
|||
|
No quite sure what you mean by empty space.. but
depending on how you generate your thumbnail.. here is some quasi-code that may help..using php <? $ImageInfo = getimagesize("imagedir/yourthumbnail"); $image_width=$ImageInfo[0]; $image_height=$ImageInfo[1]; ?> <table cellpadding=2> <tr> <td width="<?= $image_width?>" height="<?= $image_height ?>" valign="center" align="center"> [img]yourthumbnail[/img]" height="<?= $image_height ?>" alt="some optimized text"> </td> </tr> </table>
__________________
Hardcore Programming Solutions and Coffee Drinker |
|
|||
|
Hi
What you are saying is to just through it into a borderless table why didn't I think of that. What I had been trying to do was to createimage(100, 100);as the canvas and then put the resized image on the canvas. I had already done getimagesize for the original size to make the calulations 100/$width or 100/$height to obtain a percentage for the $newwidth or $newheight. I will play with that and see if that is all I need. Thanks Mike |
|
|||
|
Hi morpheus.100
Yea sounds good I am finding a lots of good info in GD, checking into imagemaqick too (bad speller). Don't want to re-invent the wheel but it does a lot of good to try sometimes. Getting a little closer every day. Mike |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |