MOON
Server: Apache
System: Linux 54-179-220-51.cprapid.com 3.10.0-1160.144.1.el7.tuxcare.els4.x86_64 #1 SMP Tue Apr 7 08:40:40 UTC 2026 x86_64
User: thehunarfound (1001)
PHP: 7.4.29
Disabled: NONE
Upload Files
File: /home/thehunarfound/www/sms/lib/image-compress/index.php
<?php

date_default_timezone_set('UTC');
require '../src/ImageCache/ImageCache.php';

function debug( $a )
{
	echo '<pre>';
	print_r( $a );
	echo '</pre><hr>';
}

?>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Image Cache Test</title>
</head>
<body>
	<?php 
		// I've defined the base URL to be included in the source, as well as the images directory
		$image = new ImageCache\ImageCache( dirname( __FILE__ ) . '/images', true, array( 'directory_name' => 'cached' ) );

		// Compress the image with either the full URL source, or its location on the server
		$sample_one = $image->compress( 'http://placehold.it/500x300.gif' );
		$sample_two = $image->compress( dirname( __FILE__ ) . '/images/500x300.gif' );
	?>
		<img src="http://placehold.it/500x300.gif">
		<img src="<?php echo $sample_one; ?>">
		<img src="<?php echo $sample_two; ?>">
	
</body>
</html>