![]() |
Automatic Thumbnail Resize
A client of mine didn't understand how to resize his images before he added them to the cart, so I wrote a quick and dirty mod to automatically resize them when he uploads them.
WARNING: - it only works for jpg's (although it can easily be changed) - it only works for images stored in the file system - it uses GD. Some servers may not have GD installed (most will) - the width is hard coded, you need to change it to the width of your images. It is line number 39 below. - it will not work for batch imports, only thumbnails added through the Modify Products section In /cart/include/func.php replace the function func_get_image_content with this: Code:
function func_get_image_content($file_upload_data, $id) { I'm sure someone with a little more time on their hands could develop this into a nice mod that works for all images, not just thumbnails and jpg's and gets its settings from the admin area. |
Depends on your version of GD too, the latest doesnt support GIF's at all and some will only resize images in 256 cols instead of supporting true colour.
Nifty mod tho kudos on posting it, I'll have to try it later on, maybe x-cart could put a similar on in the main program with a config for switching auto resizing on or off :) |
Yeh, nice post..
I think it would be a great addition if xcart were to add a utility that resizes the images as standard. Many users have no idea on how to use image editing packages and this would save a lot of bother for them. It could create 2 sizes, one for thumbs and one for detailed images. |
Re: Automatic Thumbnail Resize
Quote:
Hi Shan, nice one! Do you think this would work for sub-category icon thumbnails? I have read the forum and upgraded the sub-cat tpl to now show icons at the sub cat level, but unfortunately it resizes the 3 menu columns based on the width of the images - would the above mod limit the thumbnail size for sub-cat? Or do you happen to know how to do this ... See http://www.makeuwell.com.au/home.php?cat=66 for details of what is now happening (live site) Cheers L |
Re: Automatic Thumbnail Resize
Any updates on this? (quite an old post)
Re-sizing / cropping thumbnails would be a huge help for clients! |
All times are GMT -8. The time now is 03:20 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.