/** * * * @param string $ps_source * @param array $pa_options * @return bool */ public function read($ps_source, $pa_options = null) { $vs_path_to_exif_tool = caGetExternalApplicationPath("exiftool"); $this->opn_current_row = -1; $this->opa_row_buf = caMakeArrayKeysLowercase(caExtractMetadataWithExifTool($ps_source)); if (!is_array($this->opa_row_buf)) { return false; } return true; }
/** * Creates new array with all keys forced to lowercase. * * @param array $pa_array * @param array $pa_options No options are supported (yet) * * @return array */ function caMakeArrayKeysLowercase($pa_array, $pa_options = null) { if (!is_array($pa_array)) { return $pa_array; } $va_new_array = array(); foreach ($pa_array as $vs_k => $vm_v) { $vs_k_lc = strtolower($vs_k); if (is_array($vm_v)) { $va_new_array[$vs_k_lc] = caMakeArrayKeysLowercase($vm_v, $pa_options); } else { $va_new_array[$vs_k_lc] = $vm_v; } } return $va_new_array; }