Skip to content

Instantly share code, notes, and snippets.

@aspose-imaging
Last active March 26, 2017 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-imaging/abe6f78dd690e323471c83c07cd6fdaa to your computer and use it in GitHub Desktop.
Save aspose-imaging/abe6f78dd690e323471c83c07cd6fdaa to your computer and use it in GitHub Desktop.
The GIST contains PHP code snippets for examples of Aspose.Imaging for Cloud.
Aspose.Imaging-for-Cloud-for-PHP
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/../..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class BMPProperties {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImageBmp() {
// Upload file to Aspose Cloud Storage
$name = 'sample.bmp';
Utils::uploadFile($name);
$result = $this->imaging->GetImageBmp($name, $bitsPerPixel = 24, $horizontalResolution = 300, $verticalResolution = 300, $fromScratch = "", $outPath = "updated.bmp", $storage = "", $folder = "");
$fh = fopen(realpath(__DIR__ . '/../../../..') . '/Data/Output/updated.bmp', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$bmpProperties = new BMPProperties();
$bmpProperties->getImageBmp();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/../..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class BMPProperties {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function postImageBmp() {
$file = realpath(__DIR__ . '/../../../..') . '/Data/' . 'sample.bmp';
$result = $this->imaging->PostImageBmp($bitsPerPixel = 24, $horizontalResolution = 300, $verticalResolution = 300, $fromScratch = false, $outPath = null, $file);
$fh = fopen(realpath(__DIR__ . '/../../../..') . '/Data/Output/update-barcodeQR.bmp', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$bmpProperties = new BMPProperties();
$bmpProperties->postImageBmp();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class ImageProperties {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImageProperties() {
// Upload file to Aspose Cloud Storage
$name = "demo.tif";
Utils::uploadFile($name);
$result = $this->imaging->GetImageProperties($name, $folder = null, $storage = null);
print_r($result);
}
}
$imageProperties = new ImageProperties();
$imageProperties->getImageProperties();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/../..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class GIFProperties {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImageGif() {
// Upload file to Aspose Cloud Storage
$name = 'sample.gif';
Utils::uploadFile($name);
$result = $this->imaging->GetImageGif($name, $backgroundColorIndex = 255, $colorResolution = 7, $hasTrailer = true, $interlaced = true, $isPaletteSorted = true, $pixelAspectRatio = 10, $fromScratch = true, $outPath = "updated.gif", $folder = null, $storage = null);
$fh = fopen(realpath(__DIR__ . '/../../../..') . '/Data/Output/updated.gif', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$gifProperties = new GIFProperties();
$gifProperties->getImageGif();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/../..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class GIFProperties {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function postImageGif() {
$file = realpath(__DIR__ . '/../../../..') . '/Data/' . 'sample.gif';
$result = $this->imaging->postImageGif($backgroundColorIndex = 255, $colorResolution = 7, $hasTrailer = true, $interlaced = true, $isPaletteSorted = true, $pixelAspectRatio = 10, $fromScratch = false, $outPath = null, $file);
$fh = fopen(realpath(__DIR__ . '/../../../..') . '/Data/Output/update-barcodeQR.gif', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$gifProperties = new GIFProperties();
$gifProperties->postImageGif();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/../..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class JPGProperties {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImageJpg() {
// Upload file to Aspose Cloud Storage
$name = 'aspose.jpg';
Utils::uploadFile($name);
$result = $this->imaging->GetImageJpg($name, $quality = 100, $compressionType = "progressive", $fromScratch = false, $outPath = "updated.jpg", $folder = null, $storage = null);
$fh = fopen(realpath(__DIR__ . '/../../../..') . '/Data/Output/updated.jpg', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$jpgProperties = new JPGProperties();
$jpgProperties->getImageJpg();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/../..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class JPGProperties {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function postImageJpg() {
$file = realpath(__DIR__ . '/../../../..') . '/Data/' . 'aspose.jpg';
$result = $this->imaging->PostImageJpg($quality = 100, $compressionType = "progressive", $fromScratch = null, $outPath = "update-barcodeQR.jpg", $file);
$fh = fopen(realpath(__DIR__ . '/../../../..') . '/Data/Output/update-barcodeQR.jpg', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$jpgProperties = new JPGProperties();
$jpgProperties->postImageJpg();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/../..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class PNGProperties {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImagePng() {
// Upload file to Aspose Cloud Storage
$name = "aspose_imaging_for_cloud.png";
Utils::uploadFile($name);
$result = $this->imaging->GetImagePng($name, $fromScratch = true, $outPath = "updated.png", $folder = null, $storage = null);
$fh = fopen(realpath(__DIR__ . '/../../../..') . '/Data/Output/updated.png', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$pngProperties = new PNGProperties();
$pngProperties->getImagePng();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/../..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class PNGProperties {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function postImagePng() {
$file = realpath(__DIR__ . '/../../../..') . '/Data/aspose_imaging_for_cloud.png';
$result = $this->imaging->PostImagePng($fromScratch = true, $outPath = "update-barcodeQR.png", $file);
$fh = fopen(realpath(__DIR__ . '/../../../..') . '/Data/Output/update-barcodeQR.png', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$pngProperties = new PNGProperties();
$pngProperties->postImagePng();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/../..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class PSDProperties {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImagePsd() {
// Upload file to Aspose Cloud Storage
$name = "sample.psd";
Utils::uploadFile($name);
$result = $this->imaging->GetImagePsd($name , $channelsCount = 3, $compressionMethod = "rle", $fromScratch = false, $outPath = "updated.psd", $folder = null, $storage = null);
$fh = fopen(realpath(__DIR__ . '/../../../..') . '/Data/Output/updated.psd', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$psdProperties = new PSDProperties();
$psdProperties->getImagePsd();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/../..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class PSDProperties {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function postImagePsd() {
$file = realpath(__DIR__ . '/../../../..') . '/Data/sample.psd';
$result = $this->imaging->PostImagePsd($channelsCount = 3, $compressionMethod = "rle", $fromScratch = null, $outPath = "update-bizcard.psd", $file);
$fh = fopen(realpath(__DIR__ . '/../../../..') . '/Data/Output/update-bizcard.psd', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$psdProperties = new PSDProperties();
$psdProperties->postImagePsd();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/../..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/../..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class TIFFProperties {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function postProcessTiff() {
$file = realpath(__DIR__ . '/../../../..') . '/Data/' . 'demo.tif';
$result = $this->imaging->PostProcessTiff($compression = "ccittfax3", $resolutionUnit = "inch", $bitDepth = 1, $fromScratch = false, $horizontalResolution = 96.0, $verticalResolution = 96.0, $outPath = null, $file);
$fh = fopen(realpath(__DIR__ . '/../../../..') . '/Data/Output/sample-multi.tif', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$tiffProperties = new TIFFProperties();
$tiffProperties->postProcessTiff();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class ManipulateImage {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getCropImage() {
// Upload file to Aspose Cloud Storage
$name = 'aspose.jpg';
Utils::uploadFile($name);
$result = $this->imaging->GetCropImage($name, $format = "jpg", $x = 30, $y = 40, $width = 100, $height = 100, $outPath = "", $storage = "", $folder = "");
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/aspose.jpg', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$manipulateImage = new ManipulateImage();
$manipulateImage->getCropImage();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class ManipulateImage {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImageRotateFlip() {
// Upload file to Aspose Cloud Storage
$name = 'aspose.jpg';
Utils::uploadFile($name);
$result = $this->imaging->GetImageRotateFlip($name, $format = "png", $method = "Rotate180FlipX", $outPath = "rotateflip.png", $folder = null, $storage = null);
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/rotateflip.png', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$manipulateImage = new ManipulateImage();
$manipulateImage->getImageRotateFlip();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class ManipulateImage {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getTiffToFax() {
// Upload file to Aspose Cloud Storage
$name = "TestDemo.tif";
Utils::uploadFile($name);
$result = $this->imaging->GetTiffToFax($name , $folder = null, $storage = null, $outPath = "Fax.tiff");
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/Fax.tiff', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$manipulateImage = new ManipulateImage();
$manipulateImage->getTiffToFax();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class ManipulateImage {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function performSeveralOperationsOnImage() {
$file = realpath(__DIR__ . '/../../..') . '/Data/Input/aspose.jpg';
$result = $this->imaging->PostImageSaveAs($format = "jpg", $newWidth = 200, $newHeight = 200, $x = 100, $y = 100, $rectWidth = 100, $rectHeight = 100, $rotateFlipMethod = "rotate90flipnone", $outPath = null, $file);
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/barcodeQR.gif', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$manipulateImage = new ManipulateImage();
$manipulateImage->performSeveralOperationsOnImage();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class ManipulateImage {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function postChangeImageScale() {
$file = realpath(__DIR__ . '/../../..') . '/Data/' . 'aspose_imaging_for_cloud.png';
$result = $this->imaging->PostChangeImageScale($format = "png", $newWidth = 200, $newHeight = 200, $outPath = null, $file);
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/barcodeQR.png', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$manipulateImage = new ManipulateImage();
$manipulateImage->postChangeImageScale();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class ManipulateImage {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function postImageSaveAs() {
$file = realpath(__DIR__ . '/../../..') . '/Data/' . 'aspose.jpg';
$result = $this->imaging->PostImageSaveAs($format = "png", $outPath = null, $file);
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/barcodeQR.jpg', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$manipulateImage = new ManipulateImage();
$manipulateImage->postImageSaveAs();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class ManipulateImage {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function postTiffAppend() {
// Upload file to Aspose Cloud Storage
$name = "sample.tif";
Utils::uploadFile($name);
$appendFile = "TestDemo.tif";
Utils::uploadFile($appendFile);
$result = $this->imaging->PostTiffAppend($name , $appendFile, $storage = null, $folder = null);
print_r($result);
}
}
$manipulateImage = new ManipulateImage();
$manipulateImage->postTiffAppend();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class ManipulateImage {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function postChangeImageScale() {
$file = realpath(__DIR__ . '/../../..') . '/Data/' . 'aspose_imaging_for_cloud.png';
$result = $this->imaging->PostChangeImageScale($format = "jpg", $newWidth = 200, $newHeight = 200, $outPath = null, $file);
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/barcodeQR.png', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$manipulateImage = new ManipulateImage();
$manipulateImage->postChangeImageScale();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class TIFFFrames {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImageFrame() {
// Upload file to Aspose Cloud Storage
$name = 'TestDemo.tif';
Utils::uploadFile($name);
$result = $this->imaging->GetImageFrame($name, $frameId = 0, $newWidth = "200", $newHeight = "200", $x = "20", $y = "20", $rectWidth = "100", $rectHeight = "100", $rotateFlipMethod = "", $saveOtherFrames = false, $outPath = "", $storage = "", $folder = "");
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/frame.tif', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$tiffFrames = new TIFFFrames();
$tiffFrames->getImageFrame();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class TIFFFrames {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImageFrame() {
// Upload file to Aspose Cloud Storage
$name = 'sample-multi.tif';
Utils::uploadFile($name);
$result = $this->imaging->GetImageFrame($name, $frameId = 1, $newWidth = "", $newHeight = "", $x = "", $y = "", $rectWidth = "", $rectHeight = "", $rotateFlipMethod = "", $saveOtherFrames = "", $outPath = "frame.tiff", $storage = "", $folder = "");
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/frame.tif', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$tiffFrames = new TIFFFrames();
$tiffFrames->getImageFrame();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class TIFFFrames {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImageFrameProperties() {
// Upload file to Aspose Cloud Storage
$name = 'sample-multi.tif';
Utils::uploadFile($name);
$result = $this->imaging->GetImageFrameProperties($name, $frameId = 1, $folder = "", $storage = "");
print_r($result);
}
}
$tiffFrames = new TIFFFrames();
$tiffFrames->getImageFrameProperties();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class TIFFFrames {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImageFrame() {
// Upload file to Aspose Cloud Storage
$name = 'sample-multi.tif';
Utils::uploadFile($name);
$result = $this->imaging->GetImageFrame($name, $frameId = 1, $newWidth = "0", $newHeight = "0", $x = "0", $y = "0", $rectWidth = "0", $rectHeight = "0", $rotateFlipMethod = "rotate90flipnone", $saveOtherFrames = false, $outPath = "", $storage = "", $folder = "");
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/frame.tif', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$tiffFrames = new TIFFFrames();
$tiffFrames->getImageFrame();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class TIFFFrames {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImageFrame() {
// Upload file to Aspose Cloud Storage
$name = 'sample-multi.tif';
Utils::uploadFile($name);
$result = $this->imaging->GetImageFrame($name, $frameId = 1, $newWidth = "300", $newHeight = "300", $x = "100", $y = "100", $rectWidth = "200", $rectHeight = "200", $rotateFlipMethod = "", $saveOtherFrames = false, $outPath = "", $storage = "", $folder = "");
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/frame.tif', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$tiffFrames = new TIFFFrames();
$tiffFrames->getImageFrame();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php';
require_once realpath(__DIR__ . '/..') . '/Utils.php';
use Aspose\Imaging\ImagingApi;
use Aspose\Imaging\AsposeApp;
class TIFFFrames {
public $imaging;
public function __construct() {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$this->imaging = new ImagingApi();
}
public function getImageFrame() {
// Upload file to Aspose Cloud Storage
$name = 'TestDemo.tif';
Utils::uploadFile($name);
$result = $this->imaging->GetImageFrame($name, $frameId = 0, $newWidth = "0", $newHeight = "0", $x = "0", $y = "0", $rectWidth = "0", $rectHeight = "0", $rotateFlipMethod = "rotate90flipnone", $saveOtherFrames = false, $outPath = "", $storage = "", $folder = "");
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/frame.tif', 'w');
fwrite($fh, $result);
fclose($fh);
}
}
$tiffFrames = new TIFFFrames();
$tiffFrames->getImageFrame();
?>
# For complete examples and data files, please go to https://github.com/aspose-imaging/Aspose.Imaging-for-Cloud
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Aspose\Storage\StorageApi;
use Aspose\Storage\AsposeApp;
class Utils {
# Get App key and App SID from https://cloud.aspose.com
const appSID = "App SID";
const apiKey = "App Key";
public static function uploadFile($fileName) {
AsposeApp::$appSID = Utils::appSID;
AsposeApp::$apiKey = Utils::apiKey;
$storage = new StorageApi();
$file = realpath(__DIR__ . '/../..') . '/Data/' . $fileName;
$result = $storage->PutCreate($Path=$fileName, $versionId = null, $storage = null, $file);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment