Tell me more ×
SmugMug Stack Exchange is a question and answer site for SmugMug developers and end users. It's 100% free, no registration required.

I wrote a script to sync pictures with my smugmug account, in which I compare the md5 of local files with the md5 of the files online to see if I need to update them.

It works well for pictures in landscape orientation. However, when I do this with a picture in portrait orientation, Smugmug gives me a different md5 (using images.getInfo) than the one I get locally. That makes my script think my local copy is ahead and the online obsolete, and it uploads it again.

Is Smugmug doing something to the files behind the scenes? This happens with jpgs out of the camera for 2 different cameras at least (Canon SLRs, a 7D and a 5d3).

However, if I open my out-of-camera jpg and save it with Gimp for example, then the modified portrait picture, once uploaded to Smugmug, has the same md5 online and locally.

Has anyone run into this and what is the explanation? Is there a workaround different than opening and saving with GIMP every picture taken in portrait mode?

share|improve this question
Guessing you should try lossless rotation. – tedder42 Jun 19 '12 at 18:58
Now that you mention it, images.getInfo does not mention orientation. Maybe Smugmug rotates automatically any picture it receives that is in portrait mode. As soon as I can, I'll try to upload a picture rotated with exiftran to see if it helps. Thanks! – barsanuphe Jun 20 '12 at 8:38
For the record, Gimp, Digikam, etc, silently do the rotation, which is why opening and saving a portrait photo with either made everything work out fine. I'd prefer to keep my files intact with a correct orientation exif tag, but it seems most apps think it's better to rotate the image itself (maybe for better compatibility?). – barsanuphe Jun 20 '12 at 22:37

1 Answer

up vote 1 down vote accepted

What you describe sounds indeed like the result of the automatic rotation being applied. If your camera comes with a orientation sensor, it'll still save portrait photos in the same landscape orientation and just attach the EXIF orientation tag to include what orientation the photo was taken in. Upon uploading, SmugMug automatically rotates photos lossless according to the EXIF orientation tag.

As you already mentioned in the comments, if you rotate your photo locally before creating the MD5 checksum, you should be able to match it with the one on SmugMug.

share|improve this answer
I can confirm that smugmug silently rotates any files uploaded that are not in landscape orientation in the exif tags. I have not been able, with exiftran, jhead or jpegtran, to generate a rotated jpg with the same md5 as the one smugmug creates, so I don't know how exactly it is rotated. As a workaround I have to manually rotate all my portrait pictures (with jhead for example) so that smugmug doesn't modify what I upload. It is beyond me why smugmug can't deal with the orientation exif tag though. Thank you and tedder42 for the help. – barsanuphe Jun 20 '12 at 20:06
While I'm not an engineer, I can think of one very good reason: Not applying the rotation would mean added CPU cycles each time the backend accesses the original photo. With the rotation applied, that's a one time action and going forward the system doesn't ever need to auto rotate the photo anymore. And keep in mind that the original may be accessed more often than you'd think. Like for any custom size photo requested via the full screen slideshow I think the system uses the original if possible to create the best possible image. – Sebastian Jun 21 '12 at 7:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.