<?php
	$image = '@PART1@';
	$imageData = base64_encode(file_get_contents($image));
	echo '<div><img class="nostyle" src="data:image/jpeg;base64,' . $imageData . '"></div>';
?>

<p class="center"><span class="button-link" onclick="CopyToClipboard(this, '<?php echo $imageData; ?>');"><?php echo GetString('Copy'); ?></span></p>

<?php
	echo '<pre class="textbox">' . $imageData . '</pre>';
?>

<script>
	var timeoutCopy;
	var buttonText;
	function CopyToClipboard(elemButton, imageData)
	{
		if (!buttonText) buttonText = elemButton.innerHTML;
		window.clearTimeout(timeoutCopy);
		navigator.clipboard.writeText(imageData);
		elemButton.innerHTML += '✔';
		timeoutCopy = window.setTimeout(function() { elemButton.innerHTML = buttonText; }, 1000);
	}
</script>