/usr/share/doc/php5-exactimage/examples/test.php is in php5-exactimage 0.8.9-7+deb8u2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | #!/usr/bin/php -d extension_dir=./objdir/api/php
<?php
# ExactImage PHP Example
# Copyright (C) 2008 - 2010 Rene Rebe, ExactCODE GmbH
ini_set("include_path", "./objdir/api/php/");
//ini_set("extension_dir", "./objdir/api/php/"); // does not work here
// load the module
include("ExactImage.php");
$image = newImage();
if (decodeImageFile ($image, "testsuite/tif/4.2.04.tif"))
{
print "image decoded all fine.\n";
}
else {
print "something went wrong ...\n";
exit;
}
if (encodeImageFile ($image, "test.jpg", 80, ""))
{
print "image written all fine.\n";
} else {
print "something went wrong writing the image ...\n";
exit;
}
# advanced use, use in memory locations
$image_bits=`cat testsuite/tif/5.1.13.tif`;
if (decodeImage ($image, $image_bits))
{
print "image read from RAM.\n";
} else {
print "something went wrong decoding the RAM\n";
exit;
}
# image properties
print "Width: " . imageWidth ($image) . "\n";
print "Height: " . imageHeight ($image) . "\n";
print "Xres: " . imageXres ($image) . "\n";
print "Yres: " . imageYres ($image) . "\n";
print "Channels: " . imageChannels ($image) . "\n";
print "Channel depth: " . imageChannelDepth ($image). "\n";
# setable as well
imageSetXres ($image, 144);
imageSetYres ($image, 144);
print "Xres: " . imageXres ($image) . "\n";
print "Yres: " . imageYres ($image) . "\n";
deleteImage($image);
?>
|