diff --git a/app/asset-types/image.inc.php b/app/asset-types/image.inc.php index a5237210..ee6e174d 100644 --- a/app/asset-types/image.inc.php +++ b/app/asset-types/image.inc.php @@ -46,6 +46,17 @@ function set_extended_data($file_path) { if(isset($iptc["2#025"][0])) $this->data['@keywords'] = $iptc["2#025"][0]; } + + # get @description from a txt file + $description_path = preg_replace('/(\.[\w\d]+?)$/', '.txt', $file_path); + if (file_exists($description_path) && !is_dir($description_path)) { + $fh = fopen($description_path, 'r'); + $desc = fread($fh, filesize($description_path)); + $desc = preg_replace('/(?data['@description'] = $descM; + fclose($fh); + } }