How to show the dimensions of a document as a ratio

When we are using Image size window, width and height is displayed in percentage, pixel, inches etc. I need to get a pop up window showing the dimension of the document in ratios. Is this possible?


Here is a quick script that will calculate the ratio of the currently open document:

#target photoshop
var doc = app.activeDocument;

var ratio = reduce(doc.width.value, doc.height.value);

// by Phrogz see:
function reduce(numerator,denominator){
  var gcd = function gcd(a,b){
    return b ? gcd(b, a%b) : a;
  gcd = gcd(numerator,denominator);
  return [numerator/gcd, denominator/gcd];

Source : Link , Question Author : Manu Gopinath , Answer Author : joojaa

Leave a Comment