Skip navigation
ryan_rowell
Currently Being Moderated

access photo aspect ratio (square, portrait, landscape)

Apr 2, 2012 11:52 AM

Tags: #lightroom #sdk #lua

I need to know what the aspect ratio of an image is so i can apply css properties to it depending on it being square, landscape, or portrait. is there a propery that will return this information?

 
Replies
  • Currently Being Moderated
    Apr 2, 2012 1:00 PM   in reply to ryan_rowell

    photo:getRawMetadata( 'croppedDimensions' )

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2012 1:59 PM   in reply to ryan_rowell

    Hi Ryan,

     

    I'm not familiar with Lr web gallerys, but I think you've got the idea aspect-ratio/orientation-wise.

     

    Rob

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 8, 2012 12:41 PM   in reply to ryan_rowell

    You probably want to have outputName set to something valid, unless the caller can handle nil. LrPhoto:getRawMetadata() can return nil, as well, so you might want to check for nil before trying to use it.

     

    Also, note that LrPhoto:getRawMetadata() will need to be called from within an LrTask, either one you create yourself, or one provided by the SDK context you are running this in.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points