protected function _execute() { $this->_temp_path = $this->context->resolve_path_for_alias(Folder_name_system_temp, 'webcore-tests'); $this_url = new FILE_URL(__FILE__); $this_url->append_folder('data'); $this_url->append_folder('archives'); $this_url->replace_name_and_extension('oz_pics.zip'); $archive = new ARCHIVE($this_url->as_text()); $archive->for_each(new CALLBACK_METHOD('process_file', $this), new CALLBACK_METHOD('show_error', $this)); $zip = new ZIP_FILE($this_url->as_text()); $zip->open(); $zip->for_each(new CALLBACK_METHOD('process_file', $this), new CALLBACK_METHOD('show_error', $this)); $archive->extract_to($this->_temp_path, new CALLBACK_METHOD('show_error', $this)); }
protected function _process_for($name, $filename) { $this->_log("Processing [{$filename}] for [{$name}]", Msg_type_info); $this_url = new FILE_URL(__FILE__); $this_url->append_folder('data'); $this_url->append_folder('images'); $this_url->replace_name_and_extension($filename); if ($this->_use_internal_exif) { $image = new IMAGE(); } else { $image = new NON_INTERNAL_EXIF_IMAGE(); } $image->set_file($this_url->as_text(), true); if ($image->properties->time_created->is_valid()) { $this->_log('Extracted date/time: ' . $image->properties->time_created->as_iso(), Msg_type_info); } else { $this->_log('Could not extract date/time.', Msg_type_warning); } }