From c65fd1946aa73fe3d2dafdf05f1d4d268e760950 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 10 Jan 2011 13:53:13 -0800 Subject: [PATCH] There was no dying due to this bug, it was trapped during deserialization, not serialization. This reverts commit a0119e9e82adc4e10482d34f50734a7fcb32139a. --- docs/changelog/7.x.x.txt | 1 - lib/WebGUI/Asset/File/GalleryFile/Photo.pm | 16 ++++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f5362ef81..79cb4ed32 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -27,7 +27,6 @@ - fixed #11976: Use Container URL in search gives user Permission Denied - fixed #11985: Search.pl should warn on bad assets - fixed #12008: Activity CleanLoginHistory is too slow - - fixed #12002: Errors parsing JSON for EXIF in Gallery 7.10.6 - fixed #11974: Toolbar icons unclickable in Webkit using HTML5 diff --git a/lib/WebGUI/Asset/File/GalleryFile/Photo.pm b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm index 0f62bee73..f14ae7e42 100644 --- a/lib/WebGUI/Asset/File/GalleryFile/Photo.pm +++ b/lib/WebGUI/Asset/File/GalleryFile/Photo.pm @@ -549,17 +549,13 @@ sub updateExifDataFromFile { } # Remove other, pointless, possibly harmful keys - delete @{ $info }{qw( Directory NativeDigest CameraID CameraType )}; + for my $key ( qw( Directory NativeDigest CameraID CameraType ) ) { + delete $info->{ $key }; + } - my $json = eval { to_json ($info) }; - if ($@) { - $self->session->log->warn('Bad EXIF data in image file for Photo asset '. $self->getId .', unable to convert to JSON'); - } - else { - $self->update({ - exifData => $json, - }); - } + $self->update({ + exifData => to_json( $info ), + }); } #----------------------------------------------------------------------------