![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/.cursor-server/data/User/History/-5896b3ba/ |
<?php
// Check if GD extension is available
if (!extension_loaded('gd')) {
header('Location: /create_simple_image.php');
exit;
}
// Set content type to PNG
header('Content-Type: image/png');
// Create image with SoundStudioPro brand dimensions
$width = 1200;
$height = 630;
$image = imagecreatetruecolor($width, $height);
// Enable alpha blending
imagealphablending($image, true);
imagesavealpha($image, true);
// SoundStudioPro Brand Colors (from CSS variables)
$primary = imagecolorallocate($image, 102, 126, 234); // #667eea
$primary_dark = imagecolorallocate($image, 90, 103, 216); // #5a67d8
$secondary = imagecolorallocate($image, 118, 75, 162); // #764ba2
$accent = imagecolorallocate($image, 79, 172, 254); // #4facfe
$accent_light = imagecolorallocate($image, 96, 165, 250); // #60a5fa
$bg_dark = imagecolorallocate($image, 10, 10, 10); // #0a0a0a
$bg_card = imagecolorallocate($image, 26, 26, 26); // #1a1a1a
$text_white = imagecolorallocate($image, 255, 255, 255);
$text_secondary = imagecolorallocate($image, 160, 174, 192); // #a0aec0
$text_accent = imagecolorallocate($image, 79, 172, 254); // #4facfe
// Fill background with dark theme
imagefill($image, 0, 0, $bg_dark);
// Create beautiful gradient background
for ($y = 0; $y < $height; $y++) {
$ratio = $y / $height;
// Divine gradient: primary -> secondary -> accent
$r = (int)(102 + (118 - 102) * $ratio + (79 - 118) * $ratio * $ratio);
$g = (int)(126 + (75 - 126) * $ratio + (172 - 75) * $ratio * $ratio);
$b = (int)(234 + (162 - 234) * $ratio + (254 - 162) * $ratio * $ratio);
// Clamp values
$r = min(255, max(0, $r));
$g = min(255, max(0, $g));
$b = min(255, max(0, $b));
$gradient_color = imagecolorallocate($image, $r, $g, $b);
// Create subtle gradient overlay
for ($x = 0; $x < $width; $x++) {
$alpha = (int)(127 * (1 - $ratio) * 0.3); // Subtle overlay
$alpha = min(127, max(0, $alpha));
$overlay_color = imagecolorallocatealpha($image, $r, $g, $b, $alpha);
imagesetpixel($image, $x, $y, $overlay_color);
}
}
// Add geometric patterns for modern look
for ($i = 0; $i < 8; $i++) {
$x = rand(0, $width);
$y = rand(0, $height);
$size = rand(100, 300);
$alpha = rand(10, 30);
// Create circular patterns with brand colors
$pattern_color = imagecolorallocatealpha($image, 79, 172, 254, $alpha);
imagefilledellipse($image, $x, $y, $size, $size, $pattern_color);
}
// Create main content area with glass effect
$content_x = 80;
$content_y = 120;
$content_width = $width - 160;
$content_height = 350;
// Glass card background
$glass_bg = imagecolorallocatealpha($image, 26, 26, 26, 80);
imagefilledrectangle($image, $content_x, $content_y, $content_x + $content_width, $content_y + $content_height, $glass_bg);
// Add subtle border
$border_color = imagecolorallocatealpha($image, 102, 126, 234, 60);
imagerectangle($image, $content_x, $content_y, $content_x + $content_width, $content_y + $content_height, $border_color);
// NEW APPROACH: Load and display the logo properly
$logo_path = 'assets/images/og-logo.png';
$logo_loaded = false;
if (file_exists($logo_path)) {
$logo = imagecreatefrompng($logo_path);
if ($logo) {
// Get logo dimensions
$logo_width = imagesx($logo);
$logo_height = imagesy($logo);
echo "<!-- Logo loaded: {$logo_width}x{$logo_height} -->"; // Debug comment
// Since your logo is already 1200x630, let's use it directly
if ($logo_width == 1200 && $logo_height == 630) {
// Logo is same size as OG image - use it as background
imagecopy($image, $logo, 0, 0, 0, 0, $width, $height);
$logo_loaded = true;
} else {
// Scale logo to fit nicely
$logo_scale = 0.4;
$new_logo_width = (int)($logo_width * $logo_scale);
$new_logo_height = (int)($logo_height * $logo_scale);
// Position logo on the left side
$logo_x = $content_x + 60;
$logo_y = $content_y + 50;
// Copy and resize logo
imagecopyresampled($image, $logo, $logo_x, $logo_y, 0, 0, $new_logo_width, $new_logo_height, $logo_width, $logo_height);
$logo_loaded = true;
}
imagedestroy($logo);
}
}
// Only add musical note icon if logo NOT loaded
if (!$logo_loaded) {
// Create a musical note icon as fallback
$note_color = $accent;
$note_x = $content_x + 80;
$note_y = $content_y + 80;
// Draw musical note
imagefilledellipse($image, $note_x, $note_y, 40, 40, $note_color);
imagefilledrectangle($image, $note_x + 15, $note_y - 60, $note_x + 25, $note_y - 20, $note_color);
imagefilledellipse($image, $note_x + 20, $note_y - 70, 15, 15, $note_color);
}
// Add main title
$title = "SoundStudioPro";
$title_x = $content_x + 280;
$title_y = $content_y + 80;
// Check if we can use TTF fonts
$font_path = 'assets/fonts/Poppins-Bold.ttf';
if (function_exists('imagettftext') && file_exists($font_path)) {
// Use TTF font for beautiful typography
$font_size = 48;
$bbox = imagettfbbox($font_size, 0, $font_path, $title);
$title_width = $bbox[4] - $bbox[0];
// Add text shadow
$shadow_color = imagecolorallocatealpha($image, 0, 0, 0, 80);
imagettftext($image, $font_size, 0, $title_x + 2, $title_y + 2, $shadow_color, $font_path, $title);
// Main title
imagettftext($image, $font_size, 0, $title_x, $title_y, $text_white, $font_path, $title);
// Subtitle
$subtitle = "AI Music Creation Platform";
$subtitle_font_size = 24;
$subtitle_y = $title_y + 50;
imagettftext($image, $subtitle_font_size, 0, $title_x, $subtitle_y, $text_accent, $font_path, $subtitle);
// Tagline
$tagline = "Create Professional Music with AI";
$tagline_font_size = 20;
$tagline_y = $subtitle_y + 40;
imagettftext($image, $tagline_font_size, 0, $title_x, $tagline_y, $text_secondary, $font_path, $tagline);
// Features
$features = [
"🎵 Generate Original Tracks",
"🎧 Professional Quality Audio",
"🚀 50,000+ Creators Worldwide"
];
$feature_y = $tagline_y + 60;
foreach ($features as $feature) {
imagettftext($image, 18, 0, $title_x, $feature_y, $text_white, $font_path, $feature);
$feature_y += 35;
}
} else {
// Fallback to basic fonts
$font_size = 5;
// Main title
imagestring($image, $font_size, $title_x, $title_y, $title, $text_white);
// Subtitle
$subtitle = "AI Music Creation Platform";
$subtitle_y = $title_y + 30;
imagestring($image, $font_size - 1, $title_x, $subtitle_y, $subtitle, $text_accent);
// Tagline
$tagline = "Create Professional Music with AI";
$tagline_y = $subtitle_y + 25;
imagestring($image, $font_size - 1, $title_x, $tagline_y, $tagline, $text_secondary);
}
// Add decorative elements
// Bottom accent bar
$accent_bar_y = $content_y + $content_height + 20;
$accent_bar_height = 8;
imagefilledrectangle($image, $content_x, $accent_bar_y, $content_x + $content_width, $accent_bar_y + $accent_bar_height, $accent);
// Add subtle glow effect around content
for ($i = 0; $i < 20; $i++) {
$glow_alpha = (int)(127 * (1 - $i / 20) * 0.1);
$glow_alpha = min(127, max(0, $glow_alpha));
$glow_color = imagecolorallocatealpha($image, 102, 126, 234, $glow_alpha);
$glow_x = $content_x - $i;
$glow_y = $content_y - $i;
$glow_w = $content_width + ($i * 2);
$glow_h = $content_height + ($i * 2);
imagerectangle($image, $glow_x, $glow_y, $glow_x + $glow_w, $glow_y + $glow_h, $glow_color);
}
// Add website URL at bottom
$url = "soundstudiopro.com";
$url_x = $content_x + 60;
$url_y = $content_y + $content_height + 60;
if (function_exists('imagettftext') && file_exists($font_path)) {
$url_font_size = 16;
imagettftext($image, $url_font_size, 0, $url_x, $url_y, $text_accent, $font_path, $url);
} else {
imagestring($image, 3, $url_x, $url_y, $url, $text_accent);
}
// Output the image
imagepng($image);
imagedestroy($image);
?>