Title: Exif code simplification
Last modified: August 21, 2016

---

# Exif code simplification

 *  Anonymous User 33811
 * (@anonymized-33811)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/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
 * [http://wordpress.org/extend/plugins/yet-another-photoblog/](http://wordpress.org/extend/plugins/yet-another-photoblog/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [jaroat](https://wordpress.org/support/users/jaroat/)
 * (@jaroat)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/exif-code-simplification/#post-3916348)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/yet-another-photoblog.svg)
 * [Yet Another Photoblog](https://wordpress.org/plugins/yet-another-photoblog/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yet-another-photoblog/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yet-another-photoblog/)
 * [Active Topics](https://wordpress.org/support/plugin/yet-another-photoblog/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yet-another-photoblog/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yet-another-photoblog/reviews/)

## Tags

 * [exif](https://wordpress.org/support/topic-tag/exif/)

 * 1 reply
 * 2 participants
 * Last reply from: [jaroat](https://wordpress.org/support/users/jaroat/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/exif-code-simplification/#post-3916348)
 * Status: not resolved