LIGHTROOM: Photos cropped in DPP do not have crop recognized

  • 1
  • Question
  • Updated 5 years ago
  • (Edited)
Photos cropped in DPP (Digital Photo Professional), when opened in lightroom do not retain their crop. I have thousands of old photos previously cropped in DPP. Is there any way to get lightroom to recognize the crop?
Photo of Thomas Kerns

Thomas Kerns

  • 5 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 1
Photo of Lee Jay

Lee Jay

  • 990 Posts
  • 135 Reply Likes
Not that I know of, other than creating derivative files (JPEGs or TIFFs) from DPP.
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 382 Reply Likes
If you are willing to jump through some hoops:

* use exiftool to read the DPP crop into text format.
* use text processor (e.g. editor) to reformat.
* use exiftool to write reformatted crop info into xmp, or do it using that text processor we were talking about.
* read metadata in Lightroom.

This could be automated via plugin.

Rob
Photo of Thomas Kerns

Thomas Kerns

  • 5 Posts
  • 0 Reply Likes
Rob,
Thanks for the info. I looked at the exif data using exiftool, and there are 6 tags that describe the crop written by DPP. CropActive is a yes or no, left top, width and height are pixels, and angle is in degrees from -45 to 45.

CropActive
CropLeft
CropTop
CropWidth
CropHeight
AngleAdj

So, I can see the data in the raw file, but converting that into an xmp file, or writing a plugin is way beyond me.

It seems to me though, that since the data is there in the raw file, that on import, lightroom should be able to read it, and update the catalog accordingly with the crop data. Or they could write a plugin that would allow you to select a series of images, and apply the crop from DPP.

Anyone have or know of a plugin to do this? Or any chance of Adobe writing one, and/or including this functionality in lightroom?

Tom
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 382 Reply Likes
Good start! - The mechanics of getting the info from exiftool format to xmp format would be easy enough for any reasonably-seasoned plugin programmer, however transforming the crop coordinates is a bit trickier.

Adobe doesn't use a crop angle value, but instead performs trigonometric transformation of the crop coordinates to accomplish crop angling.

To be honest, I have an outstanding to-do item to reverse engineer the mathematics for incorporation in my xmp-crop plugin, which provides cropping presets that are applied via xmp, but does not work on rotated photos - for the reason just mentioned (that's how I know about this ;-}).

When I get around to doing that, I'll consider making a utility function to convert Canon raw crops. - fair enough for now?

Actually, I could whip up something fairly quickly that would work on un-angled photos - would that help?

PS - I may be able to provide a work-around, but I understand you would prefer it to be native in Lightroom, or in any case: provided by Adobe.

PS - Lightroom does not read *any* develop settings that it will try and translate, for *any* camera, or *any* other raw processor, and crop coordinates are no exception. It does seem like it might be worthwhile to provide migration of develop settings (and/or croppage) from DPP, NX2, C1, DxO... - but so far hasn't been deemed worth the effort.

Rob
Photo of Thomas Kerns

Thomas Kerns

  • 5 Posts
  • 0 Reply Likes
Rob,
I sure appreciate the help. I had read that Adobe did not read any camera specific (read Canon) raw settings, particularly those to do with in camera settings (saturation, contrast, tone etc), because Canon writes those in a proprietary format in the raw file, and only Canon software (zoom browser, DPP etc) could understand them. I had assumed they were encrypted or some such thing, but I see in exiftool that those settings are all visible, and understandable in the raw file, so it seems that as you mentioned, it isnt worth the effort.

To see how the xmp file was formatted, I did open one of my raw images in photoshop, crop and tilt it, then clicked done. Looks like the xmp file saves a lot of data, and I dont know if its all required. The settings that related to the crop were:

crs:CropTop="0.183206"
crs:CropLeft="0.299369"
crs:CropBottom="0.592938"
crs:CropRight="0.770348"
crs:CropAngle="-6.344619"
crs:CropConstrainToWarp="0"
crs:HasCrop="True"

In my testing, it looks like the crop top, left, bottom and right are percentages, and the angle is degrees from -90 to 90. So I guess you would need to take the image width, and multiply by the percentages to get the top and left points, then factor in the crop width to get the right and bottom points, but that is just a guess. Im not entirely sure if trim angle affects those calculations or not.

I appreciate the offer to whip up something quick on un angled photos, however, the vast majority of my crops are also straightened :-)

While it would be nice to see Adobe provide this functionality either natively in lightroom, or through a plugin, I am fine with a non-lightroom workaround.

My plan is to use lightroom completely in my workflow, instead of DPP for future shoots, however, I have several thousands of photos from previous events that I would like to import into lightroom, that were previously edited in DPP.

Consequently, if I could run some sort of workaround on previous photos, and just never edit my photos in DPP again, that would work fine.

Who knew this would all be so complicated :-)

Thanks again for your help!

Tom
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 382 Reply Likes
Crop values are 0 to 1 (i.e. fractional, 1 representing 100%) and depend on orientation. I always assumed the rotated values were computed via trigonometry, but if they are somehow computed linearly it will be easier (for me anyway, since my trigonometry is a little rusty ;-}). I'll look into it further.

PS - Develop settings are in proprietary metadata, but not encrypted/obfuscated. Once upon a time Nikon encrypted white balance, which lasted only a very short while before they realized what a colossal mistake it was. Now people can say the settings can't be read/decoded and it has some (scant) basis in historical fact. But exiftool is a testament to how readable even proprietary settings are. The extent to which Adobe interprets them is more about bang for buck... - it is true that only Canon software can apply all Canon settings without loss in translation... but crop should be losslessly transferable.
Photo of Thomas Kerns

Thomas Kerns

  • 5 Posts
  • 0 Reply Likes
Rob,
I think its linear. I cropped, and rotated clockwise to almost 40 degrees, and got the following lines in xmp
crs:CropTop="0.011402"
crs:CropLeft="0.456156"
crs:CropBottom="0.834428"
crs:CropRight="0.587417"
crs:CropAngle="38.525814"

(see screenshot below)

If I kept rotating it clockwise past 45 degrees, the number became negative, and kept reducing down to zero the closer I got to vertical. Once I got past vertical, the crop angle kept started growing again, up to 45. So it appears to be an angle, with values from -45 to 45.

Anyway, I realize you are working on an outstanding project, so no hurry, but I really do appreciate your help on this.

Tom

Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 382 Reply Likes
The crop angle is in degrees - just like you see in the UI. I'm still having a hard time imagining the crop values (i.e. top, left, bottom, right coordinates) are not computed based on trigonometry, but trying to keep an open mind...
Photo of Thomas Kerns

Thomas Kerns

  • 5 Posts
  • 0 Reply Likes
You are probably right. I tried to figure out the math to convert from the DPP crop to an xmp crop, but its beyond me.

Let me know if you figure out something.

Thanks again,
Tom
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 382 Reply Likes
Maybe somebody else knows, or can figure it:

http://feedback.photoshop.com/photosh...
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 382 Reply Likes
Crop values are polar coordinates. XmpCrop understands this, and could be adapted some day to translate DPP crops to Lightroom format. Dunno if I'll be getting around to that any time soon though.

To be honest, I'm surprised Adobe doesn't have translations for all their competition's (somewhat mappable) editing instructions - seems it would be a good selling point: "Will auto-migrate settings (approximately) from other vendors products..." - eh Adobe?

Cheers,
Rob