Results 1 to 4 of 4
  1. #1
    myalo2020 is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2020
    Posts
    2

    Access 2016 64 bit image control automatically rotate portrait photos?

    Hello
    I upgraded an old version of Access database to 2016 and replaced a third party ocx image control with access native image control.
    The image control .picture property is being dynamically assigned for each record. Like this


    PhotoPath = txtBasePath & FileName
    If Dir(PhotoPath) <> "" Then
    EmpPhoto.Picture = PhotoPath
    End If
    The photos are simple portrait photos (jpg) from the chest up. To my surprise, even if the photo was saved on the side (the person is showing horizontally) in the form, they show correctly - head up.
    Did anyone noticed that and had the same behavior? can this behavior be controlled to not automatically straighten it up?
    Thanks

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I've learned a thing or two about the image control and how it can show an image that does not seem to have the same orientation as it does in Windows File Explorer as an icon, or as shown in a DSLR view - but I don't understand what you're asking. You want an image of a person to show horizontal so that their head is at the side? To say they show horizontally in the form yet show correctly doesn't make sense to me.
    (the person is showing horizontally) in the form, they show correctly - head up.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    myalo2020 is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2020
    Posts
    2
    Thank you for taking the time and reading my post.
    Meanwhile I think I discovered what is going on and hope you can help assess my theory.
    So, this is what I think is happening:
    jpegs come with EXIF - meta data from the digital camera. One of the attributes is orientation.
    Now, explorer showing portraits "on the side" if you see what I mean because I believe it looks at the EXIF meta data orientation.
    Access on the other end, using the image control is using the actual pixels which I believe were never re-arranged to horizontal. This what was leading me to wrong conclusion that Access is rotating them and showing them "straight".

    I tried opening one of those horizontal photos in a simple image utility (irfanview) and it did show it on the side (assuming that it also looking the EXIF orientation) but when I clicked on save, i believe that it actually re-arranged the pixels rotating them 90 degrees. Now, when I opened this photo in Access it did show on the side like explorer was showing them.
    How close am I?
    To add to that, do you know of a way to load an image into an Access form based on the EXIF meta-data. I searched and I see some third party solutions like "Image viewer" but I have not tested any of them and would like to know if you have a recommendation on this issue.
    Thank you very much

    Quote Originally Posted by Micron View Post
    I've learned a thing or two about the image control and how it can show an image that does not seem to have the same orientation as it does in Windows File Explorer as an icon, or as shown in a DSLR view - but I don't understand what you're asking. You want an image of a person to show horizontal so that their head is at the side? To say they show horizontally in the form yet show correctly doesn't make sense to me.

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Let me put it this way:
    You take a portrait of someone with a DSLR rotated in portrait orientation (short sides at top and bottom) Usually, you can only review images in camera in horizontal position, so camera software rotates the image because it knows it was taken in the portrait orientation. Thus the pic in camera view is small because while the screen is horizontal, the pic is portrait oriented and the long dimension must now fit into the short screen dimension.

    You upload these images to pc and look at them as icons in File Explorer; they should appear as portrait icons as it seems that FE goes by the EXIF data. You put them into an Access image control and they are sideways, because it seems the control doesn't go by the EXIF data. So you rotate the image in an application such as PhotoShop (you can use FE but if there's a lot of them, it's a tedious one-by-one operation). You can then look at them in the image control and they seem OK but in FE, they're still sideways. It drove me nuts because I believed what I was seeing in FE, and in many cases, I went through the batch operation in PS again because of the FE view, and ended up messing them up in Access again. Turns out that the FE icon cache needs to be rebuilt after the batch operation - simply by switching to list view then back to icon view and wouldn't you know it, Access control view matches FE view. I have less hair because of that 2 or 3 day confuffle.It didn't help that I had to rotate some images but flip all (hundreds) from back to front. If you want to rotate/resize/convert/flip images in VBA, you need to use WIA code. Here's a starting point.

    Hope that makes sense.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 07-10-2020, 12:41 PM
  2. Replies: 12
    Last Post: 09-04-2018, 04:48 PM
  3. Replies: 6
    Last Post: 07-23-2018, 11:10 AM
  4. Replies: 1
    Last Post: 06-25-2017, 01:37 AM
  5. Replies: 0
    Last Post: 09-28-2015, 10:10 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums