Skip to content

Instantly share code, notes, and snippets.

@alea12
Created June 13, 2013 12:17
Show Gist options
  • Save alea12/5773236 to your computer and use it in GitHub Desktop.
Save alea12/5773236 to your computer and use it in GitHub Desktop.
<?php
require_once('class.image.php');
$target_file = 'data/' . $_GET['t'];
$size_info = getimagesize($target_file);
$original_width = $size_info[0];
$original_height = $size_info[1];
// remove dashes from top, left sides
$image = new Image($target_file);
$image->width($original_width – 1);
$image->height($original_height – 1);
$image->crop(1, 1);
$image->save();
// remove dashes from bottom, right sides
$image = new Image($target_file);
$image->width($original_width – 2);
$image->height($original_height – 2);
$image->crop(0, 0);
$image->save();
// redirect
header('Location: ' . 'http://gyazo.alea12.net/');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment