fix bug in jpeg saver.
authorjypark <jypark@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 19 Jul 2012 03:04:47 +0000 (03:04 +0000)
committerjypark <jypark@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 19 Jul 2012 03:04:47 +0000 (03:04 +0000)
it override error handler before creation.
modify override error hanler after creation

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@74153 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

ChangeLog
src/modules/savers/jpeg/evas_image_save_jpeg.c

index 284761a..4f3279d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
           never have done this. This broke the general logic of size
           hint handling.
 
+2012-07-19  Jiyoun Park(jypark)
+
+           * Fix jpeg save bug related with error handler
+
index 247f0af..c01dbdd 100644 (file)
@@ -51,8 +51,8 @@ _JPEGErrorHandler2(j_common_ptr cinfo __UNUSED__, int msg_level __UNUSED__)
 static int
 save_image_jpeg(RGBA_Image *im, const char *file, int quality)
 {
-   struct _JPEG_error_mgr jerr;
    struct jpeg_compress_struct cinfo;
+   struct _JPEG_error_mgr jerr;
    FILE               *f;
    DATA8              *buf;
    DATA32             *ptr;
@@ -68,10 +68,11 @@ save_image_jpeg(RGBA_Image *im, const char *file, int quality)
      {
        return 0;
      }
+   memset(&cinfo, 0, sizeof(cinfo));
+   cinfo.err = jpeg_std_error(&(jerr.pub));
    jerr.pub.error_exit = _JPEGFatalErrorHandler;
    jerr.pub.emit_message = _JPEGErrorHandler2;
    jerr.pub.output_message = _JPEGErrorHandler;
-   cinfo.err = jpeg_std_error(&(jerr.pub));
    if (sigsetjmp(jerr.setjmp_buffer, 1))
      {
        jpeg_destroy_compress(&cinfo);