Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/eet

Dir     : e17/libs/eet/src/lib


Modified Files:
        eet_data.c eet_memfile.c 


Log Message:


oops. memfile compatability layer bug. fixed. using ftell now. also added in
an extra "if" for "if quality >= 90 then make pixel UV sampling 1x1 not 2x2
as normal for jpeg encoding"

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/eet/src/lib/eet_data.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- eet_data.c  16 Jun 2003 13:22:48 -0000      1.7
+++ eet_data.c  17 Jun 2003 08:12:03 -0000      1.8
@@ -558,7 +558,7 @@
    struct jpeg_compress_struct cinfo;
    FILE *f;
    unsigned char *buf;
-      
+
    f =_eet_memfile_write_open(&d, &sz);
    if (!f) return NULL;
    
@@ -590,6 +590,15 @@
    cinfo.in_color_space = JCS_RGB;
    jpeg_set_defaults(&cinfo);
    jpeg_set_quality(&cinfo, quality, TRUE);
+   if (quality >= 90)
+     {
+       cinfo.comp_info[0].h_samp_factor = 1;
+       cinfo.comp_info[0].v_samp_factor = 1;
+       cinfo.comp_info[1].h_samp_factor = 1;
+       cinfo.comp_info[1].v_samp_factor = 1;
+       cinfo.comp_info[2].h_samp_factor = 1;
+       cinfo.comp_info[2].v_samp_factor = 1;
+     }
    jpeg_start_compress(&cinfo, TRUE);
 
    ptr = data;
@@ -612,9 +621,9 @@
    jpeg_finish_compress(&cinfo);
    jpeg_destroy_compress(&cinfo);
    
+   _eet_memfile_write_close(f);
    *size = sz;
    if (buf) free(buf);   
-   _eet_memfile_write_close(f);
    return d;
 }
 
@@ -625,7 +634,7 @@
    unsigned char *d;
    int *header;
    int sz1, sz2;
-   
+
    if (words_bigendian == -1)
      {
        unsigned long int v;
@@ -676,6 +685,15 @@
        cinfo.in_color_space = JCS_RGB;
        jpeg_set_defaults(&cinfo);
        jpeg_set_quality(&cinfo, quality, TRUE);
+       if (quality >= 90)
+         {
+            cinfo.comp_info[0].h_samp_factor = 1;
+            cinfo.comp_info[0].v_samp_factor = 1;
+            cinfo.comp_info[1].h_samp_factor = 1;
+            cinfo.comp_info[1].v_samp_factor = 1;
+            cinfo.comp_info[2].h_samp_factor = 1;
+            cinfo.comp_info[2].v_samp_factor = 1;
+         }
        jpeg_start_compress(&cinfo, TRUE);
        
        ptr = data;
@@ -750,6 +768,15 @@
        cinfo.in_color_space = JCS_GRAYSCALE;
        jpeg_set_defaults(&cinfo);
        jpeg_set_quality(&cinfo, quality, TRUE);
+       if (quality >= 90)
+         {
+            cinfo.comp_info[0].h_samp_factor = 1;
+            cinfo.comp_info[0].v_samp_factor = 1;
+            cinfo.comp_info[1].h_samp_factor = 1;
+            cinfo.comp_info[1].v_samp_factor = 1;
+            cinfo.comp_info[2].h_samp_factor = 1;
+            cinfo.comp_info[2].v_samp_factor = 1;
+         }
        jpeg_start_compress(&cinfo, TRUE);
        
        ptr = data;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/eet/src/lib/eet_memfile.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- eet_memfile.c       3 Feb 2003 01:07:58 -0000       1.1
+++ eet_memfile.c       17 Jun 2003 08:12:03 -0000      1.2
@@ -92,7 +92,8 @@
          {
             int j;
 
-            (*(_eet_memfile_info[i].size)) = fseek(f, 0, SEEK_END);
+            fseek(f, 0, SEEK_END);
+            (*(_eet_memfile_info[i].size)) = ftell(f);
             rewind(f);
             (*(_eet_memfile_info[i].data)) = malloc(*(_eet_memfile_info[i].size));
             if (!(*(_eet_memfile_info[i].data)))




-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to