
WLImage=WL.Class(Object,function()
{WLImage.base.constructor.call(this);this.id=0;this.productID=0;this.width=0;this.height=0;this.alt="";this.name="";},function(type)
{type.read=function(reader)
{this.id=reader.readInt("id");this.productID=reader.readInt("productID");this.width=reader.readInt("width");this.height=reader.readInt("height");this.alt=reader.readString("alt");this.name=reader.readString("path");}
type.write=function(writer)
{writer.writeElementString("id",this.id);writer.writeElementString("productID",this.productID);writer.writeElementString("width",this.width);writer.writeElementString("height",this.height);writer.writeElementString("alt",this.alt);writer.writeElementString("path",this.name);}
this.getImageDisplayMinimizeSize=function(imageWidth,imageHeight,maxWidth,maxHeight)
{if(maxWidth/imageWidth<maxHeight/imageHeight)
{if(imageWidth>maxWidth)
return{width:maxWidth,height:Math.floor(imageHeight*maxWidth/imageWidth)};}
else
{if(imageHeight>maxHeight)
return{width:Math.floor(imageWidth*maxHeight/imageHeight),height:maxHeight};}
return{width:imageWidth,height:imageHeight};}});
