Skip to content

Instantly share code, notes, and snippets.

@fly1tkg
Created February 7, 2013 19:15
Show Gist options
  • Save fly1tkg/4733355 to your computer and use it in GitHub Desktop.
Save fly1tkg/4733355 to your computer and use it in GitHub Desktop.
This file is a Photoshop script for create marker which is use for 4:3 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 * 3 / 4;
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