Skip to content

Instantly share code, notes, and snippets.

@yurukov
Created March 20, 2015 13:41
Show Gist options
  • Save yurukov/0d9f442b82c991f88fb8 to your computer and use it in GitHub Desktop.
Save yurukov/0d9f442b82c991f88fb8 to your computer and use it in GitHub Desktop.
Cut a tif file with data to the borders of Bulgaria
<?php
$file = $argv[1];
echo date('H:i:s')."\n";
$image = new Imagick($file);
echo date('H:i:s')."\n";
$image->cropImage(25000,11900,9440,23160);
$image->writeImage('cut_'.$file);
echo date('H:i:s')."\n";
$image->resizeImage(1200,0,Imagick::FILTER_LANCZOS,1);
$image->setImageFormat('JPG');
$image->writeImage('cut_'.$file.'.jpg');
echo date('H:i:s')."\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment