VBA: Why are my photos uploading sideways

PatAccess

Registered User.
Local time
Yesterday, 23:31
Joined
May 24, 2017
Messages
284
Hell Smart people,

I have a form with several photos uploading via a command button. I've made sure the images are already rotated in a portrait position but when I upload them they come out sideways. Anyone can help please?

Thank you,
 
Here you go!

Private Sub cmdAddPhoto1_Click()
Dim objPhoto As Object
Dim strfile As String
Dim strfolder As String
Dim varItem As Variant
Set objPhoto = Application.FileDialog(3)
objPhoto.allowMultiSelect = True
If objPhoto.Show Then
For Each varItem In objPhoto.SelectedItems
strfile = Dir(varItem)
strfolder = Left(varItem, Len(varItem) - Len(strfile))
MsgBox "Folder" & strfolder & vbCrLf & "File: " & strfile
PhotoSource1 = strfolder + strfile
Next
End If
Me.Refresh
Set objPhoto = Nothing
End Sub
 
Nothing stands out in your code
Sorry if this is condescending but did you save after changing the orientation?
Check in Explorer

Also what file format are they? Try changing to a different format e.g. PNG or BMP or GIF
Don't use JPG in Access

Also do read the first link at the bottom of the page
 
I did a web search on "MS Access rotate image" and found some basic ideas:

1. Access does not have an "Image.Orientation" property (or whatever it would be called). Therefore, rotate the image externally before you use it.

2. Find a commercially available image editor OR use automation to activate the image viewer you have to open, rotate, and save the image in question. Or there are some third-party ActiveX controls that will do this.

By itself, Access will not do this for you.
 
Nothing stands out in your code
Sorry if this is condescending but did you save after changing the orientation?
Check in Explorer

Also what file format are they? Try changing to a different format e.g. PNG or BMP or GIF
Don't use JPG in Access

Also do read the first link at the bottom of the page

Hello,
I've tried every other format and it was the same and it seems like it just does not take portrait images. When I cropped that same image as landscape it worked. I'll have to do it for all of them :(

Thank you so the help
 
Sorry it didn't help
Did you read the link I suggested - at the bottom of the page

All I can add is that I have no problem importing / linking images in either orientation and that includes images I have rotated first
 
Post your database with some sample photo, let's see if we've the same problem.
 
PatAccess solved his own problem by cropping the photo. For me too, the image orientation returned to what I was viewing when I cropped the image using a 3rd party software.
Isladogs, I don't see a link at the bottom of the page but would like to know what 'jpg' format is not recommended for Access. I've found it acceptable so far.
 
There used to be a similar threads list at the bottom of each thread but at the moment its missing. See my article:

JPG is a lossy format and results can be poor for JPG images in Access. PNG are a similar size and give better results
 

Users who are viewing this thread

Back
Top Bottom