<?php
header('Content-Type: application/json');
$gd_info = function_exists('gd_info') ? gd_info() : 'GD NOT INSTALLED';
echo json_encode([
    'gd_enabled' => function_exists('gd_info'),
    'gd_details' => $gd_info,
    'jpeg_support' => isset($gd_info['JPEG Support']) ? $gd_info['JPEG Support'] : 'N/A',
    'png_support' => isset($gd_info['PNG Support']) ? $gd_info['PNG Support'] : 'N/A',
    'gif_support' => isset($gd_info['GIF Support']) ? $gd_info['GIF Support'] : 'N/A'
]);
