/**
Copyright (C) 2003-2008 AJLSM, Anaphore
Voir le fichier LICENCE
**/
var PivImageVersion=Class.create();PivImageVersion.prototype={initialize:function(b,a){this.baseUrl=b;if(a){this.role=a.role;this.info=a}this.rotation=0},getRotation:function(){return this.rotation},reInitRotation:function(){this.rotation=0},setRotation:function(b,a){if(b&&b>0&&b<=360){this.rotation+=b;if(this.rotation>360){this.rotation-=360}}},isFlipped:function(){return(this.rotation==90||this.rotation==270)?true:false},getUrl:function(){var b=this.baseUrl+"/";if(this.info.src.startsWith("http://")||this.info.src.startsWith("file:/")){b=""}var a=b+this.info.src;if(this.rotation>0&&this.rotation<360){a+=((a.indexOf("?")!=-1)?"&":"?")+"r="+this.rotation}return a},getNameWithoutQueryString:function(){var a=this.getName();if(a.indexOf("?")<0){return a}else{return a.substring(0,a.indexOf("?"))}},getRole:function(){return this.role},getWidth:function(){if(this.info){return this.info.width}else{return 0}},getHeight:function(){if(this.info){return this.info.height}else{return 0}},getName:function(){if(this.info){return(this.info.name)?this.info.name:this.info.src}else{return""}},getLabel:function(){if(this.info){return this.info.label}else{return""}},getSummary:function(){var a=this.getLabel()+" ("+this.info.width+"x"+this.info.height+"px";if(this.fileSize){var b=""+(this.fileSize/(1024*1024)).toFixed(2)+"Mo";a+=", "+b.gsub(/\./,",")}a+=")";return a},getMimeType:function(){return this.info.mimetype},getTile:function(){return this.info.tile},setFileSize:function(a){this.fileSize=a},identify:function(){return"Classe PivImageVersion"}};
