*
* Copyright (C) 1999 Michael Zucchi
* Copyright (C) 1999 The Free Software Foundation
- *
+ *
* Progressive loading code Copyright (C) 1999 Red Hat, Inc.
*
* Authors: Michael Zucchi <zucchi@zedzone.mmc.com.au>
/* explode gray image data from jpeg library into rgb components in pixbuf */
static void
explode_gray_into_buf (struct jpeg_decompress_struct *cinfo,
- guchar **lines)
+ guchar **lines)
{
gint i, j;
guint w;
static void
convert_cmyk_to_rgb (struct jpeg_decompress_struct *cinfo,
- guchar **lines)
+ guchar **lines)
{
gint i, j;
if (errmgr->error && *errmgr->error == NULL) {
g_set_error (errmgr->error,
GDK_PIXBUF_ERROR,
- cinfo->err->msg_code == JERR_OUT_OF_MEMORY
- ? GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY
+ cinfo->err->msg_code == JERR_OUT_OF_MEMORY
+ ? GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY
: GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("Error interpreting JPEG image file (%s)"),
buffer);
gint i;
lptr = lines;
- for (i = 0; i < cinfo->rec_outbuf_height; i++)
+ for (i = 0; i < cinfo->rec_outbuf_height; i++)
{
*lptr++ = *dptr;
*dptr += rowstride;
jpeg_read_scanlines (cinfo, lines, cinfo->rec_outbuf_height);
- switch (cinfo->out_color_space)
+ switch (cinfo->out_color_space)
{
case JCS_GRAYSCALE:
explode_gray_into_buf (cinfo, lines);
{
ERREXIT(cinfo, JERR_INPUT_EOF);
}
- else if (num_bytes > 0)
+ else if (num_bytes > 0)
{
src->next_input_byte += (size_t) num_bytes;
src->bytes_in_buffer -= (size_t) num_bytes;
{
struct jpeg_source_mgr* src;
- if (cinfo->src == NULL)
+ if (cinfo->src == NULL)
{ /* first time for this JPEG object? */
cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small) (
(j_common_ptr) cinfo, JPOOL_PERMANENT,
jerr.error = error;
- if (setjmp(jerr.setjmp_buffer))
+ if (setjmp(jerr.setjmp_buffer))
{
/* If we get here, the JPEG code has signaled an error.
* We need to clean up the JPEG object, close the input file, and return.
jpeg_read_header(&cinfo2, TRUE);
if (cinfo.image_width != cinfo2.image_width ||
- cinfo.image_height != cinfo2.image_height)
+ cinfo.image_height != cinfo2.image_height)
{
DEBUG_1("stereo data with different size");
jpeg_destroy_decompress(&cinfo2);
{
if (cinfo.output_width != cinfo2.output_width ||
cinfo.output_height != cinfo2.output_height ||
- cinfo.out_color_components != cinfo2.out_color_components)
+ cinfo.out_color_components != cinfo2.out_color_components)
{
DEBUG_1("stereo data with different output size");
jpeg_destroy_decompress(&cinfo2);
}
- lj->pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
- cinfo.out_color_components == 4 ? TRUE : FALSE,
+ lj->pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
+ cinfo.out_color_components == 4 ? TRUE : FALSE,
8, lj->stereo ? cinfo.output_width * 2: cinfo.output_width, cinfo.output_height);
- if (!lj->pixbuf)
+ if (!lj->pixbuf)
{
jpeg_destroy_decompress (&cinfo);
if (lj->stereo) jpeg_destroy_decompress (&cinfo2);
dptr2 = gdk_pixbuf_get_pixels(lj->pixbuf) + ((cinfo.out_color_components == 4) ? 4 * cinfo.output_width : 3 * cinfo.output_width);
- while (cinfo.output_scanline < cinfo.output_height && !lj->abort)
+ while (cinfo.output_scanline < cinfo.output_height && !lj->abort)
{
guint scanline = cinfo.output_scanline;
image_loader_jpeg_read_scanline(&cinfo, &dptr, rowstride);