We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

[imgsizer] Possible to modify imgsizer plugin to add whitespace around images before resizing?

Development and Programming

Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

Hey, quick question, how hard would it be to modify the amazing imgsizer plugin to add whitespace on all 4 sides of an image before it scales it down?

I realize this might be a silly question but for one of our websites, our client will be uploading images for products that are already on a white background, however I want there to be a little more whitespace added to the images so that they look nicer instead of possibly getting parts of the product in the image cut off because they may have very little whitespace in the image to start with.

I will be using it with equal width and height parameters so that the image will be scaled from the center out.

Any hints / tips on modifying this to add the requested functionality would be greatly appreciated. It may not even be possible, I just thought I would ask.

cheers

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
16 years ago
Mark Bowen's avatar Mark Bowen

Just a quick thought on this one but could you not just use some CSS to add in the extra white colour around the images? This way then if ever you want to change the colour you can do this with a CSS rule instead of having to change all the images. Perhaps then you could get the images uploaded without any white-space around them and do it all with CSS.

Would be easier I think.

Sorry but regarding the plugin and modifying it I’m not really sure how you would do that but if you do still need that functionality then perhaps a quick e-mail to Lumis might get you an answer.

Best wishes,

Mark

       
Paul Stone's avatar
Paul Stone
97 posts
16 years ago
Paul Stone's avatar Paul Stone

I ditto Mark’s suggestion.. Unless you really need the images to have the white burned into the image, give your product images a class of product shot, say (e.g. < img src=”photo.jpg” class=”productshot” / > )

Then in your CSS

img.productshot {background:#ffffff;padding:5px;}

Hope that helps,

Paul

       
Ryan Blaind's avatar
Ryan Blaind
168 posts
16 years ago
Ryan Blaind's avatar Ryan Blaind

ahh duh. sorry guys I guess that would be a lot easier.. I will try this for sure. Thanks! 😊

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.