> 4) & 0x0F) * 17; // 0-15 → 0-255 $pixel2 = ($byte & 0x0F) * 17; imagesetpixel($img, $x, $y, $colors[$pixel1]); if ($x + 1 < $width) { imagesetpixel($img, $x + 1, $y, $colors[$pixel2]); } } } } // Simpan sebagai PNG $timestamp = date('Y-m-d_H-i-s'); $filename = "finger_{$type}_{$timestamp}.png"; $filepath = $uploadDir . $filename; imagepng($img, $filepath); imagedestroy($img); // Juga simpan raw data untuk analisis $rawFilename = "finger_{$type}_{$timestamp}.raw"; file_put_contents($uploadDir . $rawFilename, $rawData); echo "OK: $filename ($rawLen bytes)"; error_log("[FINGERPRINT] Saved: $filename | Type: $type | Raw: $rawLen bytes | Size: {$width}x{$height}"); exit; } // ════════════════════════════════════════════════════════════ // HANDLE GET — Tampilkan galeri gambar // ════════════════════════════════════════════════════════════ // Handle download if (isset($_GET['download'])) { $file = basename($_GET['download']); // Prevent path traversal $path = $uploadDir . $file; if (file_exists($path) && pathinfo($path, PATHINFO_EXTENSION) === 'png') { header('Content-Type: image/png'); header('Content-Disposition: attachment; filename="' . $file . '"'); header('Content-Length: ' . filesize($path)); readfile($path); exit; } } // Handle delete if (isset($_GET['delete'])) { $file = basename($_GET['delete']); $path = $uploadDir . $file; $rawPath = str_replace('.png', '.raw', $path); if (file_exists($path)) unlink($path); if (file_exists($rawPath)) unlink($rawPath); header('Location: picture.php'); exit; } // Handle delete all if (isset($_GET['delete_all'])) { $files = glob($uploadDir . 'finger_*'); foreach ($files as $f) { unlink($f); } header('Location: picture.php'); exit; } // Scan directory for images $images = glob($uploadDir . 'finger_*.png'); rsort($images); // Terbaru di atas $totalImages = count($images); ?> Fingerprint Image Gallery

🔎 Fingerprint Gallery

gambar
Filter:
0): ?> Hapus Semua

Belum ada gambar

Upload gambar sidik jari dari ESP32 untuk melihatnya di sini.

<?= $fname ?>