Options

uploading pictures in portrait mode, & md5 problems

barsanuphebarsanuphe Registered Users Posts: 4 Beginner grinner
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 using good old md5sum. 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? Maybe something to do with some Canon EXIF parts it doesn't like? 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.

So what is the explanation? Is there a workaround different than opening and saving with GIMP every picture taken in portrait mode? Did anyone ever see this?

Comments

  • Options
    barsanuphebarsanuphe Registered Users Posts: 4 Beginner grinner
    edited June 20, 2012
    Answering my own question for anyone googling this. It appears Smugmug does not like dealing with orientation as an exif tag. It silently rotates the uploaded file if it is in portrait mode, hence the different md5. 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.
  • Options
    olegosolegos Registered Users Posts: 93 Big grins
    edited June 26, 2012
    Thanks for tracking this down and sharing it.

    I wonder if SmugMug uses a lossless jpeg rotation algorithm, or uncompresses & recompresses.
  • Options
    SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited June 26, 2012
    I ran across this years ago when I rented a Canon 50d with an orientation sensor like most modern cameras have (mine don't). After I downloaded all the files and compared them to the originals, the portrait ones failed to compare as they were auto-rotated and hence a different file in SM than the original.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
Sign In or Register to comment.