function _variable_file_image_object in Variable Extra 7
Convert simple filepath into pseudo image object.
1 call to _variable_file_image_object()
- variable_file_form_element_file_display in variable_file/
variable_file.variable.inc - Display file information element.
File
- variable_file/
variable_file.variable.inc, line 294 - Variable module hook implementations
Code
function _variable_file_image_object($path) {
$file = new Stdclass();
$file->fid = 0;
$file->uri = $path;
$file->filename = basename($path);
if (is_file($path)) {
$file->filesize = filesize($path);
$file->filemime = file_get_mimetype($path);
}
return $file;
}