Jump to content

Resize image and pad with set colour to fit standard shape


dickiebow

Recommended Posts

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

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

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.