• 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

    http://wordpress.org/extend/plugins/yet-another-photoblog/

Viewing 1 replies (of 1 total)
  • Plugin Author jaroat

    (@jaroat)

    11 Months later … i’ll take a look since i’m planing an update.

    The exif tag names change after switching to exif_read_data?

    That would be some major issue for all sites already using exif output.

    But a leaner code base with fewer dependencies is a better codebase.

Viewing 1 replies (of 1 total)
  • The topic ‘Exif code simplification’ is closed to new replies.