Commit 62205e1b authored by keyongyu's avatar keyongyu

fix image

parent dbe4d268
...@@ -732,8 +732,14 @@ public Card[] ReadCards(string set, bool repalceOld) ...@@ -732,8 +732,14 @@ public Card[] ReadCards(string set, bool repalceOld)
/// <param name="img"></param> /// <param name="img"></param>
/// <returns></returns> /// <returns></returns>
public string getImageCache(string img,Card card){ public string getImageCache(string img,Card card){
bool isPendulum =card!=null && card.IsType(CardType.TYPE_PENDULUM);
if(isPendulum){
if(cfg.pwidth<=0 && cfg.pheight<=0)
return img;
}else{
if(cfg.width<=0 && cfg.height<=0) if(cfg.width<=0 && cfg.height<=0)
return img; return img;
}
string md5=MyUtils.GetMD5HashFromFile(img); string md5=MyUtils.GetMD5HashFromFile(img);
if(MyUtils.Md5isEmpty(md5)||cfg.imagecache==null){ if(MyUtils.Md5isEmpty(md5)||cfg.imagecache==null){
//md5为空 //md5为空
...@@ -742,9 +748,9 @@ public Card[] ReadCards(string set, bool repalceOld) ...@@ -742,9 +748,9 @@ public Card[] ReadCards(string set, bool repalceOld)
string file = MyPath.Combine(cfg.imagecache, md5); string file = MyPath.Combine(cfg.imagecache, md5);
if(!File.Exists(file)){ if(!File.Exists(file)){
//生成缓存 //生成缓存
Bitmap bmp=MyBitmap.readImage(file); Bitmap bmp=MyBitmap.readImage(img);
//缩放 //缩放
if(card!=null && card.IsType(CardType.TYPE_PENDULUM)){ if(isPendulum){
bmp=MyBitmap.Zoom(bmp, cfg.pwidth,cfg.pheight); bmp=MyBitmap.Zoom(bmp, cfg.pwidth,cfg.pheight);
}else{ }else{
bmp=MyBitmap.Zoom(bmp, cfg.width,cfg.height); bmp=MyBitmap.Zoom(bmp, cfg.width,cfg.height);
...@@ -752,7 +758,7 @@ public Card[] ReadCards(string set, bool repalceOld) ...@@ -752,7 +758,7 @@ public Card[] ReadCards(string set, bool repalceOld)
//保存文件 //保存文件
MyBitmap.SaveAsJPEG(bmp, file,100); MyBitmap.SaveAsJPEG(bmp, file,100);
} }
return img; return file;
} }
private static void exportSetThread(object obj){ private static void exportSetThread(object obj){
string[] args=(string[])obj; string[] args=(string[])obj;
......
...@@ -28,4 +28,4 @@ ...@@ -28,4 +28,4 @@
// //
// You can specify all the values or you can use the default the Revision and // You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below: // Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("2.3.5.2")] [assembly: AssemblyVersion("2.3.5.3")]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment