- * @throws \ImagickException
- */
- private static function responseFromCache(&$request)
- {
- $cachefile = get_cachefile(hash('md5', $request['url']));
- if ($cachefile != '' && file_exists($cachefile)) {
- $img = new Image(file_get_contents($cachefile), mime_content_type($cachefile));
- self::responseImageHttpCache($img);
- // stop.
- }
- return $cachefile;
- }
-
- /**
- * @brief Try to reply with image in database
- *
- * @param array $request Array from getRequestInfo
- *
- * If the image exists in database, then script ends here and this function will never returns
- * @throws \Friendica\Network\HTTPException\InternalServerErrorException
- * @throws \ImagickException
- */
- private static function responseFromDB(&$request)
- {
- $photo = Photo::getPhoto($request['urlhash']);
-
- if ($photo !== false) {
- $img = Photo::getImageForPhoto($photo);
- self::responseImageHttpCache($img);
- // stop.
- }
- }
-
- /**
- * @brief Output a blank image, without cache headers, in case of errors
- *