Exif code simplification
-
To simplify the code a bit, and make it more consistent with exif gathering in other plugins such as Exifography and phpThumb, I replaced the outdated phpExifRW with a call to the standard exif_read_data() from php.
function getExifData($yapbImage, $flagUnfiltered=false) { $result = null; /* require_once realpath(dirname(__file__) . '/phpExifRW-1.1/exifReader.inc'); $phpExifReader = new phpExifReader($yapbImage->systemFilePath()); $phpExifReader->ImageReadMode = 1; // This should turn off EXIF thumbnail caching too $result = $phpExifReader->getImageInfo(); */ $result = exif_read_data($yapbImage->systemFilePath(), 'EXIF', FALSE, FALSE); // If the user wants his EXIF data filtered, we do that if (get_option('yapb_filter_exif_data') && ($flagUnfiltered == false)) { $result = ExifUtils::filterExifData($result); }
You can now delete the phpExifRW directory which pre-dates the implementation of exif_read_data() in Php 4.2
I then retrained the filter, selected the new/standard names and voila. Less code to manage plus consistent naming across the various exif using tools.Gerrit
https://www.ads-software.com/extend/plugins/yet-another-photoblog/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Exif code simplification’ is closed to new replies.