Assigning SmugMug Print Size Keys

I believe that a picture’s aspect ratio,  its width divided by its height, should be tuned to its contents.  Consequently,  I am not a slave to standard aspect ratios and print sizes like the ones shown in the following table.

Aspect Ratio (Short/Long) Print Sizes (Inches)
0.5 4×8, 5×10, 8×16, 10×20
0.7 3.5×5, 7×10
0.666666667 4×6, 8×12, 10×15, 12×18
0.714285714 5×7
0.772727273 8.5×11

Over the years I have clipped and cropped my pictures producing a large number of nonstandard ratios. This is not a problem until I decide to order prints.

Pictures sites like SmugMug offer many standard sizes but they cannot accommodate every crank with an aspect to grind.  To print a strangely shaped picture on SmugMug you have to open up the website’s print selection tool and fit one side or your picture to a standard print size.  This leaves part of the print blank and is often called the letterbox method.  Letterboxing is not ideal but it gets the job done.

For standard print sizes there is a much better way.  The following J verb takes the pixel dimensions of my images and computes standard, 300 DPI, print size keys like: 4×6, 5×7 and 8×10. After assigning print size keys you can select and print all standard sizes with a few mouse clicks.

smugprintsizes=:3 : 0

NB.*smugprintsizes v-- compute largest print size for given dpi.
NB.
NB. Computes the  largest  print size  (relative  to  DPI x)  for
NB. SmugMug images. Only images that have aspect ratios  close to
NB. the ratios  on  (SMUGPRINTSIZES) are associated  with a print
NB. size.
NB.
NB. monad:  st=. smugprintsizes btclImages
NB.
NB.   'albums images'=. readsmugtables 0
NB.   smugprintsizes images
NB.
NB. dyad:  st=. iaDpi smugprintsizes btclImages
NB.
NB.   200 smugprintsizes images

SMUGPRINTDPI smugprintsizes y
:
nsym=.s:<''

NB. reduce image table on PID
images=. }. y [ imhead=. 0 { y
pidpos=. imhead i. <'PID'
if. 0=#images=. images #~ ~:pidpos {"1 images do. 0 2$nsym return.end.

NB. compute print sizes table
pst=. printsizestable SMUGPRINTSIZES

NB. image dimensions short x long
idims=. _1&".&> (imhead i. ;:'WIDTH HEIGHT') {"1 images
'invalid image dimensions' assert -. _1 e. idims
idims=. (/:"1 idims) {"1 idims

NB. aspect ratio and print area (square inches)
ratios=. SMUGASPECTROUND round %/"1 idims
areas=.  SMUGAREAROUND round (*/"1 idims) % *: x

NB. mask table selecting images with ratio
masks=. (SMUGASPECTROUND round ;0 {"1 pst) =/ ratios
if. -.1 e. ,masks do. 0 2$nsym return.end.

masks=. <"1 masks
pids=.  s:&.> masks #&.> <pidpos {"1 images

NB. largest print area for selected images at current DPI
masks=. (1 {"1 pst) </&.> masks #&.> <areas
pids=.  (<"1&.> masks #"1 &.> pids) -. L: 0 nsym
sizes=.  <"0&.> 2 {"1 pst
; |:&.> ; pids ,: L: 0 (# L: 0 pids) # L: 0 sizes
)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s