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
)

Setting Good SmugMug Key Words

Finding good key words is not easy.  In many ways it is like creating a good book index.  Decent book indexes are carefully constructed by human readers that understand what is being indexed and why certain terms should be included. Superior indexes showcase the gems and bury the garbage. There is a lot of mediocre software out there that purports to automate this task but I remain unimpressed.  Machine indexing is like machine language translation: they both suffer from a lack of real understanding. I was reminded of how difficult indexing is while writing some code to update my SmugMug key words.

My first attempt at computing key words followed this recipe:

  1. Run my little C# SmugMug metadata dumper to update image metadata.
  2. Sift through the image metadata and extract all current key words.
  3. Remove common English words from current key words.
  4. Similarly, extract all image caption text and remove common English words.
  5. Sort the remaining caption text key words by frequency.
  6. Append the frequency sorted caption key words to corresponding current key words.
  7. Take at most seven words from the appended list as key words.

My thinking was high frequency uncommon English words would make good keys.  This is generally the case but the removal of common English words from currently assigned keys was a big mistake.

I take care when naming image files.  SmugMug picks up words in image file names and uses them as default key words.  If you have good file names you will get useful keys automatically.  Removing common English words from file names deleted words that were present for good reasons.  For example: two common English words, “before” and “after,” are used in the file names of image restorations like this picture I took in Cyprus way back in 1968.

I think “before” and “after” are perfectly good keys for this image.

To avoid such problems I now leave file name words intact and augment these words with high frequency caption text words and print size keys like: 4×5, 4×6, 5×7 and 8×10.  Print size keys is another story. You can view my entire list of SmugMug keys here.

More on SmugMug Duplicates

In my previous post I described a method for eliminating duplicate SmugMug images based on MD5’s.   This method does not get all the duplicates.

If you uploaded the same image to different galleries,  at different times,  the SmugMug MD5’s may differ.  I don’t know what  SmugMug  rolls into their MD5 ‘s but I suspect it’s more than image data.

To get all the copies you must remove duplicate picture ids ,  file names and MD5’s.  Furthermore, to maintain a pure duplicate free state,  you need to check these items often.   Now,  after uploading or rearranging pictures,  I update my SmugMug metadata and execute this J verb to insure I don’t introduce duplicates.

CheckSmugDups=:3 : 0

NB.*CheckSmugDups v-- checks duplicate SmugMug images.
NB.
NB. monad:  CheckSmugDups uuIgnore

'albums images'=. readsmugtables 0
images=. }. images [ imhead=. 0 { images

NB. images should be unique in three ways:
r=. ,: 'PID unique: '; # ~.(imhead i. <'PID') {"1 images
r=. r, 'MD5 unique: '; # ~.(imhead i. <'MD5') {"1 images
r=. r, 'FILENAME unique: '; # ~.(imhead i. <'FILENAME') {"1 images

if. 1 <# ~. ;{:"1 r do. smoutput 'duplicates present' end.
r
)

Follow

Get every new post delivered to your Inbox.