dickiebow Posted February 21, 2008 Share Posted February 21, 2008 For design/content reasons I need to upload a variety of image shapes, resize them and fit the result into a constant sized box with the same fill colour making up the difference. I have written a script to do all the upload and resize depending on whether the width or height is the one that will be the limiting factor. But how do I place that centrally with control over the background colour of the total image? I suspect it is simple but hours of searching have not yielded the answer Quote Link to comment https://forums.phpfreaks.com/topic/92302-resize-image-and-pad-with-set-colour-to-fit-standard-shape/ Share on other sites More sharing options...
Psycho Posted February 21, 2008 Share Posted February 21, 2008 Does that background color have to be part of the image? You could just put the image in a DIV with the color. I know it's not what you asked for, but just a thought. EDIT: This should be what you want: http://us.php.net/manual/en/function.imagecopymerge.php Quote Link to comment https://forums.phpfreaks.com/topic/92302-resize-image-and-pad-with-set-colour-to-fit-standard-shape/#findComment-472942 Share on other sites More sharing options...
dickiebow Posted February 21, 2008 Author Share Posted February 21, 2008 Thanks - most helpful I thought there must be a GD function to sort it but I got lost in the listing. Quote Link to comment https://forums.phpfreaks.com/topic/92302-resize-image-and-pad-with-set-colour-to-fit-standard-shape/#findComment-472947 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.