Commits

Ondřej Surý committed 3005a1e

Revert accidental change to jpeg functions

Comments (0)

Files changed (2)

 BGD_DECLARE(gdImagePtr) gdImageCreateFromWBMPCtx (gdIOCtx * infile);
 BGD_DECLARE(gdImagePtr) gdImageCreateFromWBMPPtr (int size, void *data);
 BGD_DECLARE(gdImagePtr) gdImageCreateFromJpeg (FILE * infile);
-BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegEx (FILE * infile, int ignore_warning);
 BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegCtx (gdIOCtx * infile);
-BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegCtxEx (gdIOCtx * infile, int ignore_warning);
 BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegPtr (int size, void *data);
-BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegPtrEx (int size, void *data, int ignore_warning);
 BGD_DECLARE(gdImagePtr) gdImageCreateFromWebp (FILE * inFile);
 BGD_DECLARE(gdImagePtr) gdImageCreateFromWebpPtr (int size, void *data);
 BGD_DECLARE(gdImagePtr) gdImageCreateFromWebpCtx (gdIOCtx * infile);
 
 BGD_DECLARE(gdImagePtr) gdImageCreateFromJpeg(FILE *inFile)
 {
-	return gdImageCreateFromJpegEx(inFile, 1);
-}
-BGD_DECLARE(gdImagePtr) gdImageCreateFromJpeg(FILE *inFile, int ignore_warning)
-{
 	gdImagePtr im;
 	gdIOCtx *in = gdNewFileCtx(inFile);
 	if (in == NULL) return NULL;
-	im = gdImageCreateFromJpegCtxEx(in, ignore_warning);
+	im = gdImageCreateFromJpegCtx(in);
 	in->gd_free(in);
 	return im;
 }
 
 BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegPtr(int size, void *data)
 {
-	return gdImageCreateFromJpegPtrEx(size, data, 1);
-}
-BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegPtr(int size, void *data, int ignore_warning)
-{
 	gdImagePtr im;
 	gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0);
 	if(!in) {
 		return 0;
 	}
-	im = gdImageCreateFromJpegCtxEx(in, ignore_warning);
+	im = gdImageCreateFromJpegCtx(in);
 	in->gd_free(in);
 	return im;
 }
  */
 BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegCtx(gdIOCtx *infile)
 {
-	return gdImageCreateFromJpegCtxEx(infile, 1);
-}
-BGD_DECLARE(gdImagePtr) gdImageCreateFromJpegCtxEx(gdIOCtx *infile, int ignore_warning)
-{
 	struct jpeg_decompress_struct cinfo;
 	struct jpeg_error_mgr jerr;
 	jmpbuf_wrapper jmpbufw;
 		fprintf(stderr, "gd-jpeg: warning: jpeg_finish_decompress"
 		        " reports suspended data source\n");
 	}
-
-	if (!ignore_warning) {
-		if (cinfo.err->num_warnings > 0) {
-			goto error;
-		}
-	}
+	/* TBB 2.0.29: we should do our best to read whatever we can read, and a
+	 * warning is a warning. A fatal error on warnings doesn't make sense. */
+#if 0
+	/* This was originally added by Truxton Fulton */
+	if (cinfo.err->num_warnings > 0)
+		goto error;
+#endif
 
 	jpeg_destroy_decompress(&cinfo);
 	gdFree(row);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.