*** image.c.orig Sat Jun 1 23:09:38 2002 --- image.c Mon Jul 29 01:02:10 2002 *************** *** 382,387 **** --- 382,402 ---- flimage_close(image); + /* + * flimage_dup_ will copy the file pointer to the new image.. Its bad news to attempt to close + * the file twice so remove the duplicates here.. This possibly wants looking at further since + * its a potential hazard with all dup'd images.. + */ + if (image->next) { + FL_IMAGE *im2 = image->next; + while (im2) { + im2->fpin = NULL; + im2->fpout = NULL; + im2 = im2->next; + } + } + + image->completed = im->total; sprintf(buf, "Done Reading multi-frame %s", image->fmt_name); image->visual_cue(image, err ? "Error Reading" : buf); *** image_jpeg.c.orig Tue May 21 21:31:08 2002 --- image_jpeg.c Mon Jul 29 01:02:10 2002 *************** *** 65,76 **** static int JPEG_identify(FILE * fp) { ! char buf[128]; int i; fread(buf, 1, sizeof(buf), fp); rewind(fp); buf[sizeof(buf) - 1] = '\0'; for (i = 0; i < sizeof(buf) - 3 && buf[i] != 'J'; i++) ; --- 65,84 ---- static int JPEG_identify(FILE * fp) { ! unsigned char buf[128]; int i; fread(buf, 1, sizeof(buf), fp); rewind(fp); buf[sizeof(buf) - 1] = '\0'; + + /* + * Test for a JPEG SOI code (0xff, 0xd8) followed by the start of APP0 segement (0xff) + * A 'raw' JPEG will not have the JFIF (JPEG file interchange format) header but + * is still readable + */ + if ((buf[0] == 0xff) && (buf[1] == 0xd8) && (buf[2] == 0xff)) + return(1); for (i = 0; i < sizeof(buf) - 3 && buf[i] != 'J'; i++) ; *** image_gif.c.orig Tue May 21 21:31:08 2002 --- image_gif.c Mon Jul 29 01:02:10 2002 *************** *** 634,640 **** { OUTPIX(suffix[code]); firstchar = oldcode = code; ! return 0; } incode = code; --- 634,645 ---- { OUTPIX(suffix[code]); firstchar = oldcode = code; ! /* There is the posibility of an image with just alternate single code bytes and resets.. ! * I know thats really dumb, but I found one and it took a long time to work out why it ! * crashed.. so this dirty goto makes sure we always check and flush the buffer before ! * it overuns.. ! */ ! goto linecheck; } incode = code; *************** *** 672,677 **** --- 677,683 ---- } while (stackp > stack); + linecheck: /* if we've got more than one scanline, output */ incode = lbuf - lhead; if (incode >= im->w)