changeset 1386:9f3f20c4a4fb

Use jpg instead of PNG. Fix the issue that we load the last image when the SVG is not loaded correctly.
author wycc
date Fri, 25 Mar 2011 03:52:33 +0800
parents 2ebb07ee455e
children 17fd2b733154
files nodejs/examples/mce/epg.js
diffstat 1 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/nodejs/examples/mce/epg.js	Fri Mar 25 02:31:55 2011 +0800
+++ b/nodejs/examples/mce/epg.js	Fri Mar 25 03:52:33 2011 +0800
@@ -52,10 +52,10 @@
         var ext = fields.pop();
 	var pngfile = cachepath;
 	sys.puts("ext="+ext);
-	if (ext != 'png') {
-	    fields.push('png');
-	    pngfile = fields.join('.');
-	}
+	//if (ext != 'png') {
+	//    fields.push('png');
+	//    pngfile = fields.join('.');
+	//}
         var st = fs.statSync(pngfile);
 	try {
 	    fs.unlinkSync(file);
@@ -63,9 +63,13 @@
 	}
 	fs.linkSync(pngfile, file);
         obj.pend = obj.pend - 1;
-        if (obj.pend == 0) {
-            obj.onInitDone();
-        }
+	try {
+            if (obj.pend == 0) {
+                obj.onInitDone();
+            } 
+	} catch(e) {
+	    sys.puts(e);
+	}
 	return 1;
     } catch(e) {
 	sys.puts(e);
@@ -154,7 +158,7 @@
     this.maincat = cats;
     for (i in cats) {
 	c = cats[i];
-	httpGetFile(c['ProgramPIC'],'cat'+i+'.png',this);
+	httpGetFile(c['ProgramPIC'],'cat'+i+'.jpg',this);
     }
 }