Hiroyuki Ikezoe
ikezo****@users*****
Tue Sep 12 08:50:05 JST 2006
Index: kazehakase/src/mozilla/MozillaPrivate.cpp diff -u kazehakase/src/mozilla/MozillaPrivate.cpp:1.12 kazehakase/src/mozilla/MozillaPrivate.cpp:1.13 --- kazehakase/src/mozilla/MozillaPrivate.cpp:1.12 Tue Sep 12 08:12:23 2006 +++ kazehakase/src/mozilla/MozillaPrivate.cpp Tue Sep 12 08:50:05 2006 @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id: MozillaPrivate.cpp,v 1.12 2006/09/11 23:12:23 ikezoe Exp $ + * $Id: MozillaPrivate.cpp,v 1.13 2006/09/11 23:50:05 ikezoe Exp $ */ /* @@ -346,11 +346,12 @@ nsCOMPtr<nsIDOMCanvasRenderingContext2D> domCanvas = do_QueryInterface(context, &rv); if (NS_FAILED(rv) || !domCanvas) return FALSE; - domCanvas->Scale(EGG_PIXBUF_THUMB_LARGE / KZ_CANVAS_WIDTH, KZ_THUMB_HEIGHT / KZ_CANVAS_HEIGHT); - //domCanvas->Scale(0.25, 0.25); + float sx, sy; + sx = (float) EGG_PIXBUF_THUMB_LARGE / KZ_CANVAS_WIDTH; + sy = (float) KZ_THUMB_HEIGHT / KZ_CANVAS_HEIGHT; + domCanvas->Scale(sx, sy); rv = domCanvas->DrawWindow(domWindow, 0, 0, KZ_CANVAS_WIDTH, KZ_CANVAS_HEIGHT, NS_LITERAL_STRING("rgb(0,0,0)")); - //rv = domCanvas->DrawWindow(domWindow, 0, 0, 1024, 768, NS_LITERAL_STRING("rgb(0,0,0)")); if (NS_FAILED(rv)) return FALSE; nsCOMPtr<nsIInputStream> imgStream; @@ -387,12 +388,12 @@ } gchar *thumb_filename; - thumb_filename = egg_pixbuf_get_thumb_filename(uri, - EGG_PIXBUF_THUMB_LARGE); - g_file_set_contents(thumb_filename, imgData, imgSize, NULL); + thumb_filename = egg_pixbuf_get_thumb_filename(uri, EGG_PIXBUF_THUMB_LARGE); + gboolean ret = g_file_set_contents(thumb_filename, imgData, imgSize, NULL); + g_free(imgData); g_free(thumb_filename); - - return TRUE; + + return ret; } #endif