From 6d00b2e63dba0761d2bb82b56c59f9bacce97b7c Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 25 May 2022 08:14:59 +0000 Subject: bump php version requirement --- Zotlabs/Photo/PhotoDriver.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'Zotlabs/Photo/PhotoDriver.php') diff --git a/Zotlabs/Photo/PhotoDriver.php b/Zotlabs/Photo/PhotoDriver.php index 6bdb89ab1..f50ef17ae 100644 --- a/Zotlabs/Photo/PhotoDriver.php +++ b/Zotlabs/Photo/PhotoDriver.php @@ -344,19 +344,13 @@ abstract class PhotoDriver { return false; } - /* - * PHP 7.2 allows you to use a stream resource, which should reduce/avoid - * memory exhaustion on large images. - */ - - if(version_compare(PHP_VERSION, '7.2.0') >= 0) { - $f = @fopen($filename, 'rb'); - } else { - $f = $filename; - } + $f = @fopen($filename, 'rb'); if($f) { - return @exif_read_data($f, null, true); + // exif_read_data accepts a stream resource in php > 7.2 + $x = @exif_read_data($f, null, true); + fclose($f); + return $x; } return false; -- cgit v1.2.3