btg-sandbox-image-scale/status.php
DJP 8be6a1ecab Initial commit: Topaz Labs Gigapixel Image Upscaler web application
- PHP-based web interface for image upscaling using Topaz Labs API
- Multiple image upload with batch processing support
- AI model selection (Standard V2, Low Resolution V2, CGI, etc.)
- Output resolution options from 2K to 8K
- Face enhancement feature
- Real-time job tracking and status monitoring
- Bulk download functionality
- Dark mode toggle
- Microsoft authentication integration
- Comprehensive README with installation instructions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 14:15:31 -04:00

34 lines
No EOL
1,019 B
PHP

<?php
include 'config.php';
header('Content-Type: application/json');
if (isset($_GET['process_id'])) {
$process_id = $_GET['process_id'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.topazlabs.com/image/v1/status/$process_id");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Accept: application/json',
'X-API-Key: ' . API_TOKEN
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($response === false) {
echo json_encode(['error' => 'cURL error: ' . curl_error($ch)]);
} else {
$data = json_decode($response, true);
if (json_last_error() === JSON_ERROR_NONE) {
echo $response; // Return the raw JSON response
} else {
echo json_encode(['error' => 'Invalid JSON response', 'raw_response' => $response]);
}
}
curl_close($ch);
} else {
echo json_encode(['error' => 'No process ID provided']);
}