Dim bm As Bitmap
bm.Initialize(dir, filename) 'Saved picture
Dim bm2 As BitmapExtended
Dim exifdata1 As ExifData
Try
exifdata1.Initialize(dir, filename)
Select Case exifdata1.getAttribute(exifdata1.TAG_ORIENTATION)
Case exifdata1.ORIENTATION_ROTATE_180 '3.- transform = rotate 180
bm=bm2.rotateBitmap(bm,180)
saveRotatedPicture(bm, dir, filename)
Case exifdata1.ORIENTATION_ROTATE_90 '6.- transform = rotate 90
bm=bm2.rotateBitmap(bm,90)
saveRotatedPicture(bm, dir, filename)
Case exifdata1.ORIENTATION_ROTATE_270 '8.- transform = rotate 270"
bm=bm2.rotateBitmap(bm,270)
saveRotatedPicture(bm, dir, filename)
End Select
Catch
End Try