Skip to content

Instantly share code, notes, and snippets.

@fly1tkg
Last active December 12, 2015 06:58
Show Gist options
  • Save fly1tkg/4733362 to your computer and use it in GitHub Desktop.
Save fly1tkg/4733362 to your computer and use it in GitHub Desktop.
This file is a Photoshop script for create marker which is use for 16:9 aspect ratio Movie AR by CARKCHO(https://app.carkcho.com).
/*
author: Shoichi Takagi
*/
var width;
var height;
var movieWidth;
var movieHeight;
var getImageSize = function() {
width = activeDocument.width.value;
height = activeDocument.height.value;
};
var cropFitMovieSize = function() {
getImageSize();
movieWidth = width;
movieHeight = width * 9 / 16;
var margin = (height - movieHeight) / 2;
preferences.rulerUnits = Units.PIXELS;
activeDocument.crop([0, margin, width, height - margin]);
};
var cropMarker = function() {
getImageSize();
var margin = (width - height) / 2;
preferences.rulerUnits = Units.PIXELS;
activeDocument.crop([margin, 0,width - margin,height]);
};
cropFitMovieSize();
cropMarker();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment