ImageRotate_IrfanView

Rotates an image using irfanview (i_view32.exe attached)
Rotated image can be renamed into new file, or if blank will override original image
IVFol = Resources folder is expected to be next to workbook

Sub ImageRotate_IrfanView(FullImage, Left1_Right2, Optional RotatedImage = "", Optional IVFol = "Resources")
 ' Left1_Right2: 1 to rotate to the left, 2 to rotate right
 ' IVFol: folder name that is next to this workbook where ivew is expected to be
 LeftRight = " /rotate_l"
 If Left1_Right2 = 2 Then LeftRight = " /rotate_r"
 Exe1 = "i_view32.exe"
 If Not IsThere(Exe1, FixPath() & IVFol, True, True) Then Exit Sub
 If Not IsThere1(FullImage, True, True) Then Exit Sub
 If RotatedImage > "" Then
  If Not IsThere1(RotatedImage, True, True) Then Exit Sub
 Else
  RotatedImage = FullImage
 End If
 FullCmd = Chr(34) & FixPath(FixPath() & IVFol) & Exe1 & Chr(34) & " " & Chr(34) & FullImage & Chr(34) & _
  LeftRight & " /silent /convert=" & Chr(34) & RotatedImage & Chr(34)
 Shell FullCmd, vbHide
 DoEvents
' "D:\ANmar.Systems\Projects.Individual\2014 Bryxit\Resources\i_view32.exe" "D:\ANmar.Systems\Projects.Individual\2014
 ' Bryxit\Images.source\LeegoLand120.jpg" /rotate_r /convert="D:\ANmar.Systems\Projects.Individual\2014
 ' Bryxit\Images.source\LeegoLand120.jpg"
End Sub

FullImage, Left1_Right2, Optional RotatedImage, Optional IVFol

Views 354 Downloads 140

'FixPath', 'IsThere1', 'IsThere', 'i_view32.exe', 'irfanview', 'image', 'picture', 'thumbnail', 'thumbnails', 'iview', 'irfan view', 'reduce', 'enlarge', 'width', 'height', 'replace', 'change', 'substititue'

ANmarAmdeen
324
Attachments
Multimedia VBA-Excel
Revisions

v2.0