CyberiaPC.com Community Forums Main Page
RSS Feeds: Late(st) News | Zenith Picture Gallery | Most Recent Community Topics | Tips, Tricks and Other Useful Stuff

Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
> Adding fixed-sized frames to all your thumbnails
Rating 5 V
usr.c
post Apr 19 2007, 04:02 PM
Post #1


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




Tested on v0.9.2. It will probably work with all other versions; if anything blows up, let me know!

Look in image_man.php for

CODE
$thumbnail = imagecreatetruecolor($sizemin[0],$sizemin[1]);
@imagecopyresampled($thumbnail, $image, 0, 0, 0, 0, $sizemin[0], $sizemin[1], $size[0], $size[1]); //resize and resample image

and replace it with

CODE
//start of fixed-size-background-for-thumbs mod (April 16, 2007)
$thumbnail = imagecreatetruecolor($config['thumb_width'], $config['thumb_height']);
imagefill($thumbnail, 0, 0, 0x000000); //change 3rd parameter if you want (e.g. 0xFFFFFF for white)
@imagecopyresampled($thumbnail, $image, ($config['thumb_width']-$sizemin[0])/2, ($config['thumb_height']-$sizemin[1])/2, 0, 0, $sizemin[0], $sizemin[1], $size[0], $size[1]); //resize and resample image
//end of fixed-size..lalalala...thumbs mod

Add a new image to test it. You'll have to recreate your thumbs from the Admin CP to update your existing thumbs (if you've upgraded from a previous version and you get an error message during the recreation process, look at the files under the uploads directory and make sure there aren't any orphaned files. If you find any, delete them!)


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch
I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 26th May 2013 - 04:44 AM