DeAspect

Quite correctly, Lightroom 4 reads the AspectFrame metadata of raw files and crops the photo accordingly on import. The only drawback of this approach is, that it is not possible to change this later on in Lightroom.
As a reaction to this, I sat down and got into Lua, in order to write a little plugin automating the exiftool workflow proposed in some user forums.

The workflow looks as follows:

  • A new menu entry “DeAspect current selection” is added in the Library menu.
  • If the entry is called without a selection, nothing happens.
  • If the entry is called with a selection, the selected photos will be passed to
    exiftool -AspectRatio=”” -AspectFrame=”0 0 0 0″ -DefaultCropOrigin=”” -DefaultCropSize=”” -CroppedImageWidth=”WIDTH” -CroppedImageHeight=”HEIGHT” -o “NEW” “ORIG”
  • The newly created file NEW is then imported and stacked on top of the original photo.
  • As a manual step, the previews should be re-rendered for the new files.

Requirements:

  • exiftool needs to be installed and available on PATH

License:

Creative Commons License
DeAspect
by Tim Jagenberg is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Download:

2012-08-16: DeAspect_0-1-3.lrplugin.zip

  • New exiftool call
    “exiftool -AspectRatio=”” -AspectFrame=”0 0 0 0″ -DefaultCropOrigin=”” -DefaultCropSize=”” -CroppedImageWidth=”WIDTH” -CroppedImageHeight=”HEIGHT” -o “NEW” “ORIG””
    reading WIDTH and HEIGHT from exiftool -ImageWidth -ImageHeight
    works with DNG, ORF and CR2.

2012-05-15: DeAspect_0-1-2.lrplugin.zip

  • Changed call from “exiftool.exe” to “exiftool” for cross platform compatibility
  • New exiftool call
    “exiftool -AspectRatio=”” -AspectFrame=”0 0 0 0″ -DefaultCropOrigin=”” -DefaultCropSize=”” -o “NEW” “ORIG”
    works with DNG and ORF.

2012-05-13: DeAspect_0-1-1.lrplugin.zip

  • Initial public release

Just to make it perfectly clear: This is my first, inexperienced work with Lua and Lightroom plugins, it is a quick and dirty solution. Let me cite section 5 and 6 from the cc-by-sa license agreement:

5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability.
EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

30 thoughts on “DeAspect

  1. Andre

    Nice tool!

    ### Here a little feature request:
    Possibilty to stop DeAscpect-Progress

    ### Solution for DeAspect.lua:
    23a23
    > progress:setCancelable(true)

    31a31
    > if progress:isCanceled() then
    > break
    > end

  2. Nick

    need help with the plug in and how it works. I just shot a job and did not realize the aspect ratio lines were a hard crop. I am desperate to regain the original information that I can see in preview (which is 2×3) and not the 4:3 that was set in the mark iii camera. I am using Lightroom 4 and a Mac

  3. Zack Jones

    Thank you for creating this plugin! I spend a whole day shooting in 1:1 format with my E-M5 thinking it would write a RAW file in 4:3 aspect ratio and JPG in 1:1. Boy was I surpised to see nothing but RAW files. Your plugin allowed me to reset the aspect ratio very easily.

  4. Suchy

    Hi Tim – thanks very much for this. Does this pug-in work with 5D III files? I have downloaded it and tried working with 5D III files in Lightroom but it seems to create a file with deaspect in the name but with no change to the file. Any comment would be appreciated.

  5. Renaud Savignard

    Hi Tim, you saved my day ! I was looking were this f… crop information (E-M5) was. Trying with GraphicConverter led me to ExifTools, which led me to your site. Just great !! Thanks.

  6. Andre Malenfan

    Hi, thanks for this plugin! Much appreciated. I used to run exiftool command-line as I couldn’t find the courage to build a LR plugin :)

    I have one problem though. It works perfectly fine in LR but the new file cannot be previewed on mac osx. I mean in the finder or Preview. I get a grey square. Maybe with the way you change the aspect ratio values?

    I don’t have this problem if I do the same task with

    -AspectFrame=”0 0 4031 3023″ -AspectRatio=4:3

    for my Olympus E-P3 (ORF) camera RAW files.

    Could you provide a way to customize the parameters to exiftools?

    Thanks!

  7. Tim Post author

    Thanks for your comment, I’ll look into that issue.
    Might need you help for testing, as I don’t have OSX.

  8. billy

    Hi thanks for putting this together, however I can’t seem to get it to work with my EM-5 files on Lightroom 4. When I try the export i receive “an internal error has occured: [string "deaspect.lua"]44: attempt to concatenate local ‘heigh’ (a nil value)

    IF you could help with that, or tell me the correct command to run exiftool separately (im quite comfortable running command lines, i just cant get it to run correctly with the right variables) I would greatly appreciate it. I only need to do one file! lol

  9. Tim Post author

    Sorry, even with the additional information you provided me, I could not replicate the issue.
    I guess Lightroom cannot find exiftool on the path.

  10. jen jen

    just wanted to say thank you Tim for saving my butt! i just got a new 5d mkIII and din’t realise that my friend had changed my aspect ratio till 3/4 of the way through shooting a wedding! spewing!

  11. Tito

    Tim, I’m having the exact same problem as billy up there. Whenever I try to use the DeAspect, it gives me this error message:

    “An internal error has occurred: [string "DeAspect.lua"]:44: attempt to concatenate local ‘height’ (a nil value)”

    I’m using Lightroom 4.2 64-bits, on a Windows 7 PC, with 5D3 files shot in video-mode.
    Thanks!

  12. ThemeLibre

    Thanks a lot for this really helpful script.
    I love to shoot in 1:1 RAW format on my OM-D and I’ve been so disappointed to see that LR4 was not allowing to retrieve the original 4:3 picture (ideal for framing adjustment).
    I’ve now been able to rework some very precious pictures’ framing :)
    Thanks again !

  13. ThemeLibre

    Addition to Andre’s great correction for blind previews of “DeAspected” pictures in the Finder:

    – Open the DeAspect.lrplugin package (Mac user)
    – Edit “DeAspect.lua” (TextEdit app is well suited for this)
    – look for this text section:
    “exiftool -AspectRatio=\”\” -AspectFrame=\”0 0 0 0\”

    – For the Olympus OM-D you the have to replace it by the following text:
    “exiftool -AspectRatio=\”4/3\” -AspectFrame=\”0 0 4608 3456\”

    In general I guess that you have to put the appropriate AspectRatio (3/2 or 4/3) et your RAW file native resolution (4608 x 3456 pixel on the OM-D) and it should work for any camera :)

  14. Greg

    Tim, could you help me please.
    I get only msg »“An internal error has occurred: [string "DeAspect.lua"]:44: attempt to concatenate local ‘height’ (a nil value)”
    What do i wrong?
    Thanks!

  15. Tim Post author

    You need to make sure that exiftool is accessible without the full path, i.e. the location of it needs to be in your system path variable. Restart Lightroom to ensure it’s using the updated path variable.

  16. Andrew Webb

    This is fabulous! Thanks very much.

    How hard would it be to make a version of the plugin that operated on the selected file without creating a duplicate file? (It would be great if it created a Develop Module Snapshot with the current crop before it reset, but adding a crop afterwards isn’t exactly difficult.)

    As a side note, this works fine on DNG files which were created from Olympus OMD-EM5 ORFs which had an in-camera crop set.

  17. Daniel Silverberg

    To help clarify for anyone else who also had issues, you have place the exiftool.exe in the folder that is defined as your system’s path variable. See http://en.wikipedia.org/wiki/PATH_(variable) for an explanation. I followed the steps at http://java.com/en/download/help/path.xml to determine the default PATH variable location for my system. As a Windows 7 user, the first default variable value was C:\Program Files\Common Files\Microsoft Shared\Windows Live, so I copied exiftool.exe here, and it worked.

  18. Tim Post author

    Hey Daniel,

    thanks a lot for the information! I guess this will help a few users to avoid the PATH issues.

  19. CHris

    I only get an error message. I tried restarting Lightroom several times.

    [string "DeAspect.lua"]:44: attempt to concatenate local ‘height’ (a nil value)

  20. Lee Grider

    Nothing listed above comes close to working.
    I’ve edited the path, and supposedly installed the exiftool
    I’ve tried to add the DeAspect.lua file..but get an error message..
    I’ve followed every step exactly as outlined and nothing…

    So i am stuck, and I think this process is too difficult to get to work.
    Might be a lifesaver, as this Aspect Ratio has bitten me bad on a job.

  21. Kelvin

    How should I modify the code if i dun want to create a backup copy of the raw file but restore the aspect ratio directly in the source raw file?

  22. Samuel Dorado

    Hi Tim,
    I am new to computer coding, but have managed to get this to ALMOST work. I am able to run the plugin with DNG converted (from ORF) files in Lightroom. However the aspect ratio remains the same on the stacked image. I am maybe missing what to do for the “a manual step, the previews should be re-rendered for the new files” part. Can you give some sort of explanation on what you mean here.

    Sam

  23. Tim Post author

    What happens if you try it with the ORF directly? Could you sent me the ORF and DNG files as samples?

  24. Marco

    Hi Tim,

    just installed the plugin and applied it to a set of cropped pictures shot with my 5d mkiii (I’m using LR5). It works smoothly. A big thank you for your great work!!!

    Marco

  25. Samatcha

    Could you please give me explanation on how to install exiftool, please?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>