Free Shopping Carts - OsCommerce, Cre Loaded, Magento....
Its been days since i have return my last post. I was kept really busy by my employer. To be honest i was also a bit lazy in thinking of something new for my blog.
None of the less i spent a lot of my recent time working on free Shopping Cart Applications.
There are some really interesting points that i would like to share about these Apps.
First of all the very thing that came to my mind is that "If people are providing good free software on the internet then what will happen to us hard working Software Developers".
To back up my thoughts i would like to press the points that these free Shopping Cart solutions provide a great bit of functionality, something that would take a lot of time to build from the scratch. Also the communities are pretty active and provide further customization support.
A few of their cool features include.
1.CMS support
2.Paypal , Authorize.Net etc payment modules.
3.FedEx , UPS, UPSC etc shipping modules.
4.Multilingual Suppport.
5.Multi Store Support (Magento)
6. And off course great catalog support
The sad part for me was that the only major thing that i was doing is understanding the structure, design integration and bug solving!!
There were times when i was really scratching my brains trying to search solution to a simple problem and just couldn't find it. Yes and Magento was the one to be blamed!!!
But the fact that not may people are aware of these Free Applications (yes these people are the end clients), having knowledge of customizing them can really be very handy.
Here's a short rating of the apps based on my experience of handling them:
1.CRE Loaded - Great out of the box and easy to setup, tech support
2.Magento - Huge functionality provided but takes ages to understand and setup due to overly streched mechanism. Also functions really Slowly(and i mean really slowly compared to any PHP site)
3.Oscommerce - Base version of cre loaded. Needs lot of customization.
4.Joomla-Virtue Mart - Has the power of Joomla with it. Good for setting up small store.
ASP.NET MVC, Javscript, JQuery, Angular JS, HTML 5, CSS3
Web Services, Web Api, SQL Server, C#.NET, Azure
Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts
17 May 2009
01 December 2008
Dynamic Thumbnail Generation
Thumbnail creation is an very important process for websites incorporating image upload functionality.
User can upload any type of image to the server which needs to be re-sized according to our web page designs.
Following is the code required for the task in ASP.NET 2.0:
void create_thumb(String file_path,int pre_width,int pre_height)
{
System.Drawing.Image myImage;
System.Drawing.Image oThumbNail;
int newHeight, newWidth;
Graphics oGraphic;
Rectangle oRectangle;
myImage = System.Drawing.Image.FromFile(Server.MapPath("images") + "/" + file_path);
if (myImage.Height < pre_height && myImage.Width < pre_width)
{
newWidth = myImage.Width;
newHeight = myImage.Height;
}
else
{
if (myImage.Height > myImage.Width)
{
newHeight = pre_height;
newWidth = ((myImage.Width * pre_height) / myImage.Height);
}
else if (myImage.Height < myImage.Width)
{
newWidth = pre_width;
newHeight = ((myImage.Height * pre_width) / myImage.Width);
}
else
{
newWidth = pre_width;
newHeight = ((myImage.Height * pre_width) / myImage.Width);
}
}
if (myImage.PixelFormat == PixelFormat.Indexed)
oThumbNail = new Bitmap(newWidth, newHeight, myImage.PixelFormat);
else
oThumbNail = new Bitmap(newWidth, newHeight);
oGraphic = Graphics.FromImage(oThumbNail);
oGraphic.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed;
oGraphic.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed;
oGraphic.InterpolationMode=System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
oRectangle = new Rectangle(0, 0, newWidth, newHeight);
oGraphic.DrawImage(myImage, oRectangle);
Response.ContentType = "image/Jpeg";
oThumbNail.Save(Server.MapPath("images/Thumbnails") + "/" + file_path,System.Drawing.Imaging.ImageFormat.Jpeg);
myImage.Dispose(); //needed to free the resources and file handles
}
Following is the code required for the task in PHP:
function create_thumb($file_path,$pre_width,$pre_height)
{
list($orig_width, $orig_height) = getimagesize($file_path);
$target_path="images/thumbnails/"
if ($orig_height < $pre_height && $orig_width < $pre_width)
{
$newWidth = $orig_width;
$newHeight = $orig_height;
}
else
{
if($orig_height > $orig_width)
{
$newHeight = $pre_height;
$newWidth = (($orig_width * $pre_height) / $orig_height);
}
else if ($orig_height < $orig_width)
{
$newWidth = $pre_width;
$newHeight = (($orig_height * $pre_width) / $orig_width);
}
else
{
$newWidth = $pre_width;
$newHeight = (($orig_height * $pre_width) / $orig_width);
}
}
$image_p = imagecreatetruecolor($newWidth, $newHeight);
if($file_ext=='gif' || $file_ext=='GIF')
$image = imagecreatefromgif($file_path);
if($file_ext=='png' || $file_ext=='PNG' )
$image = imagecreatefrompng($file_path);
if($file_ext=='jpeg' || $file_ext=='jpg')
$image = imagecreatefromjpeg($file_path);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $newWidth, $newHeight, $orig_width,$orig_height);
if($file_ext=='jpeg' || $file_ext=='jpg' || $file_ext=='JPG' )
imagejpeg($image_p, $target_path.$newname, 100);
if($file_ext=='gif' || $file_ext=='GIF')
imagegif($image_p, $target_path.$newname, 100);
if($file_ext=='png' || $file_ext=='PNG')
imagepng($image_p, $target_path.$newname);
}
Note: This function is designed to first save the image to a location on server and then
generated thumbnails and save in a separate folder. You can customize it according to your need.
Subscribe to:
Posts (Atom)