منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
طلب اضافة ختم الصور لهذا الكود - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (https://vb4arb.com/vb)
+-- قسم : قسم برمجة وتطوير المواقع (https://vb4arb.com/vb/forumdisplay.php?fid=51)
+--- قسم : قسم PHP (https://vb4arb.com/vb/forumdisplay.php?fid=58)
+---- قسم : قسم اسئلة PHP (https://vb4arb.com/vb/forumdisplay.php?fid=59)
+---- الموضوع : طلب اضافة ختم الصور لهذا الكود (/showthread.php?tid=56206)

الصفحات: 1 2 3 4 5


RE: طلب اضافة ختم الصور لهذا الكود - nnnjk - 04-04-26

مشكور
الكود الاول والثاني ينقل جميع الصور ويغير امتدادها الى jpg ويختمها ماعدا امتداد webp ينقلها فقط ولا يختمها
ماقصرت انتهينا من الموضوع هذا


RE: طلب اضافة ختم الصور لهذا الكود - nnnjk - 05-04-26

(03-04-26, 06:59 PM)nnnjk كتب : بعد تطبيق الكود الاخير ظهر خطأ
Parse error: syntax error, unexpected ';' in /home/username/domains/alshafeen.site/public_html/vb/y2kswimgcache.php on line 78
مركب سكربت بسيط لرفع الملفات
ينقل الصور جميعها حتى من صحيفة الرياض
جرب
http://alshafeen.site/uploads.php

بعد تطبيق الكود الاخير ظهر خطأ
Parse error: syntax error, unexpected ';' in /home/username/domains/alshafeen.site/public_html/vb/y2kswimgcache.php on line 78
مركب سكربت بسيط لرفع الملفات
ينقل الصور جميعها حتى من صحيفة الرياض
جرب
http://alshafeen.site/uploads.php
مركب فيه هذا الكود فقط
PHP كود :
$context stream_context_create([
    'ssl' => [
        'verify_peer' => false,
        'verify_peer_name' => false,
    ],
]); 

(04-04-26, 05:42 PM)nnnjk كتب : اضافة الى ماسبق يبدوا ان دالة سحب الملف ودالة ختم الصور لهما الدور الاساسي في النقل
هذا كود سكربت بسيط لسحب الملفات من رابط يسحب جميع الصور ويختمها سوا من صحيفة المرصد او صحيفة الرياض او خبرني لاكن لاينقل الصور من موقع ويكيبيديا
<?php
function watermark($name, $ext, $logo){

if (preg_match("/jpg|jpeg/",$ext)){$src_img=imagecreatefromjpeg($name);}

if (preg_match("/webp/",$ext)){$src_img=imagecreatefromwebp($name);}
if (preg_match("/png/",$ext)){$src_img=imagecreatefrompng($name);}
if (preg_match("/gif/",$ext)){$src_img=imagecreatefromgif($name);}

$src_logo = imagecreatefrompng($logo);

    $bwidth  = imageSX($src_img);
    $bheight = imageSY($src_img);
    $lwidth  = imageSX($src_logo);
    $lheight = imageSY($src_logo);

//fix bug for 1beta3
if ( $bwidth > 160 &&  $bheight > 130 ) {

    $src_x = $bwidth - ($lwidth + 5);
    $src_y = $bheight - ($lheight + 5);
    ImageAlphaBlending($src_img, true);
    ImageCopy($src_img,$src_logo,$src_x,$src_y,0,0,$lwidth,$lheight);

if (preg_match("/jpg|jpeg/",$ext)){imagejpeg($src_img, $name);}
if (preg_match("/png/",$ext)){imagepng($src_img, $name);}
if (preg_match("/webp/",$ext)){imagewebp($src_img, $name);}
if (preg_match("/gif/",$ext)){imagegif($src_img, $name);}

}# < 150
else
{
return false;
}

}
$context = stream_context_create([
    'ssl' => [
        'verify_peer' => false,
        'verify_peer_name' => false,
    ],
]);
//blog.theonlytutorials.com
//author: agurchand

$memory_limit='128M';

$max_execution_time='300';
if($_POST){
//get the url
$url = $_POST['url'];

//add time to the current filename
$name = basename($url);
list($txt, $ext) = explode(".", $name);
$name = time();
$name = $name.".".$ext;


$ext=".jpg".$ext;
// $ext = end($sepext);     
/*$t=array('jpg' , 'png' , 'gif','ip' , 'rar');
    if(!in_array($ext,$t))
{ echo gggg;}else  {
*/
//here is the actual code to get the file from the url and save it to the uploads folder
//get the file from the url using file_get_contents and put it into the folder using file_put_contents
$upload = file_put_contents("uploads/$name",file_get_contents($url,false,$context));
$fileplace="uploads";

@watermark($fileplace."/".$name,$ext,'logo/logo.png');
//include('Thumbnail.class.php');
// $thumb=new Thumbnail("$name");
// $thumb->quality='100'; 

      // $thumb->process();   
      // generate image
// $thumb->save("$name");
  $filesk= "$name";
//$name = str_replace("?format=jpg","gg",$filesk);
echo $TXTREM ;
//check success
if($upload)
echo "Success:$name <a href='uploads/".$name."' target='_blank'>Check Uploaded</a>"; else "please check your folder permission";
}
//}
?>

<html>
<head><title>Theonlytutorials - Simple File Upload from URL Script!</title></head>
<body>
<h3>Theonlytutorials.com - Very Simple File Upload from URL Script!</h3>
<form action="" method="post">
Your URL: <input type="text" name="url" />
<input type="submit" value="upload Images" name="upload"/>
</form>
</body>
</html>

الله يعطيك العافيه على المجهود
ختم الصوره لاكن ظهرت سوداء ليس فيها محتوى

ممكن مساعده بعد استخدام السكربت وسحب الصوره نوع jpg من صحيفة الرياض خرج لي الخطأ التالي
PHP كود :
Warningfile_get_contents(https://www.alriyadh.com/media/thumb/11/4c/830_0b6a196952.jpg): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/username/domains/alshafeen.site/public_html/uploads.php on line 84 

وجدت هذا الحل لاكني لم افهمه
126


Try u cURL.
Copy

كود :
<?php
$curl_handle=curl_init();
curl_setopt($curl_handle, CURLOPT_URL,'http://###.##.##.##/mp/get?mpsrc=http://mybucket.s3.amazonaws.com/11111.mpg&mpaction=convert format=flv');
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_USERAGENT, 'Your application name');
$query = curl_exec($curl_handle);
curl_close($curl_handle);
?>

[url=https://stackoverflow.com/a/697540]Share



RE: طلب اضافة ختم الصور لهذا الكود - Amir_Alzubidy - 05-04-26

PHP كود :
<?php

// تحميل الصورة باستخدام cURL
function downloadImage($url){
    $ch curl_init($url);
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
    curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue);
    curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
    curl_setopt($chCURLOPT_USERAGENT"Mozilla/5.0");
    curl_setopt($chCURLOPT_REFERER$url);

    $data curl_exec($ch);

    if(curl_errno($ch)){
        curl_close($ch);
        return false;
    }

    curl_close($ch);
    return $data;
}

// ختم الصورة
function watermark($filePath$ext$logo){

    if ($ext == 'jpg' || $ext == 'jpeg') {
        $img = @imagecreatefromjpeg($filePath);
    } elseif ($ext == 'png') {
        $img = @imagecreatefrompng($filePath);
    } elseif ($ext == 'gif') {
        $img = @imagecreatefromgif($filePath);
    } elseif ($ext == 'webp') {
        $img = @imagecreatefromwebp($filePath);
    } else {
        return false;
    }

    if (!$img) return false;

    $logoImg imagecreatefrompng($logo);

    $imgW imagesx($img);
    $imgH imagesy($img);
    $logoW imagesx($logoImg);
    $logoH imagesy($logoImg);

    // مكان الشعار (أسفل اليمين)
    $x $imgW - ($logoW 10);
    $y $imgH - ($logoH 10);

    imagealphablending($imgtrue);
    imagesavealpha($imgtrue);

    imagecopy($img$logoImg$x$y00$logoW$logoH);

    // حفظ كـ JPG
    imagejpeg($img$filePath90);

    imagedestroy($img);
    imagedestroy($logoImg);

    return true;
}


// عند الإرسال
if($_POST){

    $url trim($_POST['url']);

    if(!$url){
        die("❌ أدخل رابط الصورة");
    }

    // تحميل الصورة
    $imageData downloadImage($url);

    if(!$imageData){
        die("❌ فشل تحميل الصورة (الرابط محمي أو غير صحيح)");
    }

    // استخراج الامتداد
    $ext strtolower(pathinfo(parse_url($urlPHP_URL_PATH), PATHINFO_EXTENSION));

    if(!$ext){
        $ext "jpg";
    }

    // اسم جديد
    $name time() . ".jpg";
    $filePath "uploads/" $name;

    // حفظ الصورة
    file_put_contents($filePath$imageData);

    // ختم الصورة
    watermark($filePath$ext"logo/logo.png");

    echo "✅ تم بنجاح: <a href='$filePath' target='_blank'>عرض الصورة</a>";
}
?>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>رفع وختم الصور</title>
</head>
<body>

<h3>تحميل وختم صورة من رابط</h3>

<form method="post">
<input type="text" name="url" style="width:400px" placeholder="ضع رابط الصورة هنا">
<input type="submit" value="تحميل وختم">
</form>

</body>
</html> 



RE: طلب اضافة ختم الصور لهذا الكود - nnnjk - 05-04-26

يعطيك العافيه
بعد سحب الملف من صحيفة الرياض نوع jpg طلعت الصوره سوداء فارغه


RE: طلب اضافة ختم الصور لهذا الكود - Amir_Alzubidy - 05-04-26

(05-04-26, 01:27 PM)nnnjk كتب : يعطيك العافيه
بعد سحب الملف من صحيفة الرياض نوع jpg طلعت الصوره سوداء فارغه

PHP كود :
<?php
// دالة تحميل الصورة باستخدام cURL مع Referer و User-Agent
function downloadImage($url){
    $ch curl_init($url);
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
    curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue);
    curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
    curl_setopt($chCURLOPT_USERAGENT"Mozilla/5.0");
    curl_setopt($chCURLOPT_REFERER"https://www.alriyadh.com/"); // مهم للصحف
    $data curl_exec($ch);
    if(curl_errno($ch) || !$data){
        curl_close($ch);
        return false;
    }
    curl_close($ch);
    return $data;
}
// دالة ختم الصورة باستخدام Imagick
function watermark($imageData$logoPath$outputPath){
    $im = new Imagick();
    $im->readImageBlob($imageData);
    // تحويل كل الصور إلى JPG
    $im->setImageFormat("jpeg");
    // تحميل الشعار
    $logo = new Imagick($logoPath);
    $logo->setImageFormat("png");
    // مكان الختم أسفل اليمين
    $x $im->getImageWidth() - $logo->getImageWidth() - 10;
    $y $im->getImageHeight() - $logo->getImageHeight() - 10;
    // دمج الشعار على الصورة
    $im->compositeImage($logoImagick::COMPOSITE_OVER$x$y);
    // حفظ الصورة النهائية
    $im->writeImage($outputPath);
    $im->clear();
    $im->destroy();
    $logo->clear();
    $logo->destroy();
    return true;
}
// عند إرسال النموذج
if($_POST){
    $url trim($_POST['url']);
    if(!$url) die("❌ أدخل رابط الصورة");
    $imageData downloadImage($url);
    if(!$imageData) die("❌ فشل تحميل الصورة (الرابط محمي أو غير صالح)");
    // اسم جديد للملف
    $name time() . ".jpg";
    $filePath "uploads/" $name;
    // تأكد من مجلد uploads موجود وصالح للكتابة
    if(!file_exists("uploads")) mkdir("uploads"0777true);
    // تطبيق الختم وحفظ الصورة
    watermark($imageData"logo/logo.png"$filePath);
    echo "✅ تم تحميل وختم الصورة: <a href='$filePath' target='_blank'>عرض الصورة</a>";
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>تحميل وختم الصور باستخدام Imagick</title>
</head>
<body>
<h3>تحميل وختم صورة من رابط</h3>
<form method="post">
<input type="text" name="url" style="width:400px" placeholder="ضع رابط الصورة هنا">
<input type="submit" value="تحميل وختم">
</form>
</body>
</html> 

[*]يدعم كل الصور: JPG، PNG، GIF، WEBP، ويحولها إلى JPG
[*]يمنع ظهور الصور سوداء (باستخدام Imagick بدل GD)
[*]يختم الصور باستخدام شعار PNG أسفل اليمين
[*]يدعم روابط الصحف و المواقع المحمية بـ Referer
بغض النظر عن حجم الصورة أو نوع ترميزها

ملاحظة مهمة
تأكد من وجود مجلد uploads/ وصلاحياته 755 أو 777
[*]تأكد من وجود شعارك في logo/logo.png
يحتاج PHP مع Imagick مثبتة  ( php-imagick )
مواقع الأخبار مثل صحيفة الرياض تستخدم روابط صور مؤقتة (Dynamic URLs)

او الرابط نفسه من صحيفة الرياض غير موجود أو انتهت صلاحيته.


RE: طلب اضافة ختم الصور لهذا الكود - nnnjk - 05-04-26

بعد تجربة الكود طلع خطأ
Fatal error: Class 'Imagick' not found in /home/username/domains/alshafeen.site/public_html/upload2.php on line 20


RE: طلب اضافة ختم الصور لهذا الكود - Amir_Alzubidy - 05-04-26

(05-04-26, 01:54 PM)nnnjk كتب : بعد تجربة الكود طلع خطأ
Fatal error: Class 'Imagick' not found in /home/username/domains/alshafeen.site/public_html/upload2.php on line 20
هذا الخطأ يعني أن مكتبة Imagick غير مثبتة على الاستضافة، لذلك PHP لا تعرف الكلاس Imagick

المفروض الان يحل المشكلة . 
PHP كود :
<?php
// تحميل الصورة باستخدام cURL
function downloadImage($url){
    $ch curl_init($url);
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
    curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue);
    curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
    curl_setopt($chCURLOPT_USERAGENT"Mozilla/5.0");
    curl_setopt($chCURLOPT_REFERER"https://www.alriyadh.com/");
    $data curl_exec($ch);
    if(curl_errno($ch) || !$data){
        curl_close($ch);
        return false;
    }
    curl_close($ch);
    return $data;
}
// ختم الصورة باستخدام GD
function watermark($filePath$logoPath){
    $ext strtolower(pathinfo($filePathPATHINFO_EXTENSION));
    if($ext == 'jpg' || $ext == 'jpeg'){
        $img = @imagecreatefromjpeg($filePath);
    } elseif($ext == 'png'){
        $img = @imagecreatefrompng($filePath);
    } elseif($ext == 'gif'){
        $img = @imagecreatefromgif($filePath);
    } elseif($ext == 'webp'){
        $img = @imagecreatefromwebp($filePath);
    } else {
        return false;
    }
    if(!$img) return false;
    $logo imagecreatefrompng($logoPath);
    $imgW imagesx($img);
    $imgH imagesy($img);
    $logoW imagesx($logo);
    $logoH imagesy($logo);
    $x $imgW $logoW 10;
    $y $imgH $logoH 10;
    imagealphablending($imgtrue);
    imagesavealpha($imgtrue);
    imagecopy($img$logo$x$y00$logoW$logoH);
    // حفظ الصورة كـ JPG دائماً
    imagejpeg($img$filePath90);
    imagedestroy($img);
    imagedestroy($logo);
    return true;
}
// عند إرسال النموذج
if($_POST){
    $url trim($_POST['url']);
    if(!$url) die("❌ أدخل رابط الصورة");
    $imageData downloadImage($url);
    if(!$imageData) die("❌ فشل تحميل الصورة (الرابط محمي أو غير صالح)");
    $name time() . ".jpg";
    $filePath "uploads/" $name;
    if(!file_exists("uploads")) mkdir("uploads"0777true);
    file_put_contents($filePath$imageData);
    watermark($filePath"logo/logo.png");
    echo "✅ تم تحميل وختم الصورة: <a href='$filePath' target='_blank'>عرض الصورة</a>";
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>تحميل وختم الصور باستخدام GD</title>
</head>
<body>
<h3>تحميل وختم صورة من رابط</h3>
<form method="post">
<input type="text" name="url" style="width:400px" placeholder="ضع رابط الصورة هنا">
<input type="submit" value="تحميل وختم">
</form>
</body>
</html> 



RE: طلب اضافة ختم الصور لهذا الكود - nnnjk - 05-04-26

فعلا رابط صورة صحيفة الرياض الصوره غير موجوده
بعد تجربة الكود السابق تبين مايلي
الكود يعمل لاكن لي ملاحظات
1-تحويل جميع الصور الى jpg فليت يحولها لرابطها الاساسي
2- لايختم الصور من نوع webp و avif
اذا كان نوع الملف غير معروف يحولها الى jpg دون ان يختم


RE: طلب اضافة ختم الصور لهذا الكود - Amir_Alzubidy - 05-04-26

(05-04-26, 02:06 PM)nnnjk كتب : فعلا رابط صورة صحيفة الرياض الصوره غير موجوده
بعد تجربة الكود السابق تبين مايلي
الكود يعمل لاكن لي ملاحظات
1-تحويل جميع الصور الى jpg فليت يحولها لرابطها الاساسي
2- لايختم الصور من نوع webp و avif
اذا كان نوع الملف غير معروف يحولها الى jpg دون ان يختم

PHP كود :
<?php
// تحميل الصورة باستخدام cURL
function downloadImage($url){
    $ch curl_init($url);
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
    curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue);
    curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
    curl_setopt($chCURLOPT_USERAGENT"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36");
    curl_setopt($chCURLOPT_REFERER"https://www.alriyadh.com/");
    curl_setopt($chCURLOPT_TIMEOUT30);
    $data curl_exec($ch);
    if(curl_errno($ch) || !$data){
        curl_close($ch);
        return false;
    }
    curl_close($ch);
    return $data;
}
// كشف نوع الملف الحقيقي من البيانات
function getImageType($imageData) {
    $finfo finfo_open(FILEINFO_MIME_TYPE);
    $mime finfo_buffer($finfo$imageData);
    finfo_close($finfo);
    
    
return [
        'mime' => $mime,
        'ext' => match($mime) {
            'image/jpeg' => 'jpg',
            'image/png' => 'png',
            'image/gif' => 'gif',
            'image/webp' => 'webp',
            'image/avif' => 'avif',
            default => 'jpg'
        }
    ];
}
// ختم الصورة باستخدام GD مع دعم جميع الأنواع
function watermark($filePath$logoPath){
    $imageType getImageType(file_get_contents($filePath));
    $ext $imageType['ext'];
    
    
// تحميل الصورة حسب نوعها
    $img match($ext) {
        'jpg''jpeg' => @imagecreatefromjpeg($filePath),
        'png' => @imagecreatefrompng($filePath),
        'gif' => @imagecreatefromgif($filePath),
        'webp' => function_exists('imagecreatefromwebp') ? @imagecreatefromwebp($filePath) : false,
        'avif' => false// GD لا يدعم AVIF حالياً
        default => false
    
};
    
    
if(!$img) return false;
    
    
// تحميل الشعار
    $logo = @imagecreatefrompng($logoPath);
    if(!$logo) return false;
    
    $imgW 
imagesx($img);
    $imgH imagesy($img);
    $logoW imagesx($logo);
    $logoH imagesy($logo);
    
    
// التأكد من أن الشعار لا يتجاوز حجم الصورة
    if($logoW $imgW || $logoH $imgH) {
        imagedestroy($img);
        imagedestroy($logo);
        return false;
    }
    
    $x 
$imgW $logoW 10;
    $y $imgH $logoH 10;
    
    
// تفعيل الشفافية
    imagealphablending($imgtrue);
    imagesavealpha($imgtrue);
    imagealphablending($logotrue);
    imagesavealpha($logotrue);
    
    
// نسخ الشعار مع الحفاظ على الشفافية
    imagecopy($img$logo$x$y00$logoW$logoH);
    
    
// حفظ الصورة بنفس النوع الأصلي
    $result match($ext) {
        'jpg''jpeg' => imagejpeg($img$filePath90),
        'png' => imagepng($img$filePath9),
        'gif' => imagegif($img$filePath),
        'webp' => function_exists('imagewebp') ? imagewebp($img$filePath90) : false,
        default => false
    
};
    
    imagedestroy
($img);
    imagedestroy($logo);
    return $result;
}
// معالجة النموذج
if($_POST){
    $url trim($_POST['url']);
    if(empty($url)) {
        die("❌ أدخل رابط الصورة");
    }
    
    $imageData 
downloadImage($url);
    if(!$imageData) {
        die("❌ فشل تحميل الصورة (الرابط محمي أو غير صالح)");
    }
    
    
// إنشاء مجلد التحميل
    if(!file_exists("uploads")) {
        mkdir("uploads"0777true);
    }
    
    $imageType 
getImageType($imageData);
    $name time() . "." $imageType['ext'];
    $filePath "uploads/" $name;
    
    
// حفظ الصورة
    if(file_put_contents($filePath$imageData) === false) {
        die("❌ فشل حفظ الصورة");
    }
    
    
// إضافة الختم
    if(watermark($filePath"logo/logo.png")) {
        $fileSize filesize($filePath);
        $fileSizeMB round($fileSize 1024 10242);
        echo "✅ تم تحميل وختم الصورة بنجاح!<br>";
        echo "<a href='$filePath' target='_blank'><img src='$filePath' style='max-width:500px;max-height:500px;border:2px solid #4CAF50;'></a><br>";
        echo "<strong>الحجم: {$fileSizeMB} ميجابايت</strong> | <a href='$filePath' download>تحميل الصورة</a>";
    } else {
        // إذا فشل الختم، احذف الصورة وعرض رسالة
        unlink($filePath);
        echo "⚠️ تم تحميل الصورة لكن فشل إضافة الختم<br>";
        echo "<a href='$filePath' target='_blank'>عرض الصورة بدون ختم</a>";
    }
    exit;
}
?>
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>تحميل وختم الصور المتقدم</title>
<style>
body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}
h3 {
    text-align: center;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
form {
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
input[type="text"] {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 20px;
    box-sizing: border-box;
    background: rgba(255,255,255,0.9);
}
input[type="submit"] {
    width: 100%;
    padding: 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}
input[type="submit"]:hover {
    background: #45a049;
}
.supported {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 14px;
}
</style>
</head>
<body>
<h3>?️ تحميل وختم صورة من رابط (جميع الصيغ)</h3>
<form method="post">
    <input type="text" name="url" placeholder="مثال: https://example.com/image.jpg أو .png أو .webp أو .avif" required>
    <input type="submit" value="? تحميل وختم الصورة">
</form>
<div class="supported">
    ✅ <strong>الصيغ المدعومة:</strong> JPG, PNG, GIF, WebP<br>
    ⚠️ AVIF: يتم تحميلها كـ JPG بدون ختم (GD لا يدعمها)<br>
    ? يحتفظ بالصيغة الأصلية مع الختم
</div>
</body>
</html> 

للعلم فقط الاستضافة لديك لا تدعم  مكتبة Imagick 
لذلك GD لا يدعم AVIF يتم تحميلها كـ JPG .