From 12b768a06a0de0b9f8aa536f8747f1bfb18e85c4 Mon Sep 17 00:00:00 2001 From: mwilliams Date: Thu, 30 May 2013 18:20:45 -0700 Subject: [PATCH] Make exif parser more robust Currently, as soon as it finds a bad field, it gives up. Some android devices consistently create a bad field (that we dont care about) right before fields that we do care about (the orientation, in particular). Most exif parsers just move on to the next field in this case; this changes ours to do the same. --- hphp/runtime/ext/ext_image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hphp/runtime/ext/ext_image.cpp b/hphp/runtime/ext/ext_image.cpp index 4cae25935..5d496f3e5 100644 --- a/hphp/runtime/ext/ext_image.cpp +++ b/hphp/runtime/ext/ext_image.cpp @@ -6320,7 +6320,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, raise_warning("Process tag(x%04X=%s): Illegal byte_count(%ld)", tag, exif_get_tagname(tag, tagname, -12, tag_table), byte_count); - return 0; + return 1; // ignore that field, but don't abort parsing } if (byte_count > 4) {