From 0398569f7c0211dfdd14d9553756090252ac4d16 Mon Sep 17 00:00:00 2001 From: Mattia Mascarello Date: Fri, 26 Aug 2022 04:06:44 +0200 Subject: [PATCH] Best resolution --- src/gdImg/gd.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gdImg/gd.php b/src/gdImg/gd.php index 125db93..c23589f 100644 --- a/src/gdImg/gd.php +++ b/src/gdImg/gd.php @@ -59,19 +59,18 @@ function flagGetFromUser($p){ } function dlImage($userId,$fileName){ - - $r=API("getUserProfilePhotos", ["user_id" => $userId]); $n=$r["result"]["photos"]; -$a=0;//count($n)-1; +$a=0;//photo num $b=count($n[$a])-1; -$file_id=$r["result"]["photos"][0][0]["file_id"]; +$file_id=$r["result"]["photos"][0][$b]["file_id"]; if($file_id==null){ copy("gdImg/default.jpg",$fileName); return 0; } $fO=API("getFile", ["file_id" => $file_id]); +//file_put_contents("Dda",json_encode($fO, JSON_PRETTY_PRINT)); $fu="https://api.telegram.org/file/".$GLOBALS["config"]["lgbt"]["TOKEN"]."/".$fO["result"]["file_path"]; unlink($fileName); $ch = curl_init($fu);