• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

nikon

Crop Factor Calculator

November 13, 2022

If you’re into photography, you would know what crop factor means. I have a Nikon D90 camera with a crop factor of 1.5. For example, if you use a 24mm full frame lens on a D90, the focal length will be 36mm. So, here’s a handy bash script that calculates the crop factor by multiplying the full frame focal length by 1.5.

#!/bin/bash
if [ $# -eq 0 ]
  then
    echo "Usage: cropfactor.sh 24"
    exit
fi
a=$(echo "1.5 * $1" | bc)
echo "Cropfactor focal length is: " $a"mm."

#!/bin/bash if [ $# -eq 0 ] then echo "Usage: cropfactor.sh 24" exit fi a=$(echo "1.5 * $1" | bc) echo "Cropfactor focal length is: " $a"mm."

Result

ulysses@penguin:~/Code$ ./cropfactor.sh 24
Cropfactor focal length is:  36.0mm.

ulysses@penguin:~/Code$ ./cropfactor.sh 24 Cropfactor focal length is: 36.0mm.

Filed Under: Linux Tagged With: 1.5, bash, crop, d90, factor, nikon

  • Home
  • About
  • Archives

Copyright © 2023