Ignore:
Timestamp:
Oct 24, 2008, 2:03:15 PM (12 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Added file extension detection to modular codec
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/codec/modular/jpeg.c

    r3081 r3083  
    4848    if(!fp) goto end;
    4949
    50 
     50    /* Set callbacks */
    5151    cinfo.err = jpeg_std_error(&jerr);
    5252    jerr.error_exit = error_msg;
     
    5555    jerr.format_message = format_msg;
    5656
     57    /* Initialize libjpeg */
    5758    jpeg_create_decompress(&cinfo);
    5859    cinfo.client_data = 0x0;
     
    7071    }
    7172
     73    /* One scanline */
    7274    image = malloc(cinfo.output_width * cinfo.output_height * 4);
    7375    if(!image) goto end;
     
    7577    scanline = malloc(cinfo.output_width * 3);
    7678
    77     /* Read scanlines, converting them to RGBA */
     79
    7880    for(i=0; i < cinfo.output_height; i++)
    7981    {
     
    134136    data = pixels->pixels;
    135137
    136 
    137138    line = malloc(img->w * 3 * sizeof(unsigned char));
    138139    if (!line)
     
    175176            ptr++;
    176177        }
    177         /* write scanline */
    178178        jbuf = (JSAMPROW *) (&line);
    179179        jpeg_write_scanlines(&cinfo, jbuf, 1);
Note: See TracChangeset for help on using the changeset viewer.