Hi ...
you can download the files from:
[login to view URL]
to check the healthy of image ; you can use the following function:
Public Function IsImageCorrupted(img As String) As Boolean
On Error GoTo Handler
Dim myImage As Object
Set myImage = LoadPicture([login to view URL] & "\" & img)
myImage = Nothing
IsImageCorrupted = False
Handler:
If [login to view URL] = 481 Then
IsImageCorrupted = True
End If
End Function
to compress the jpg image; I have a compressor using c++ ; I am using it in VBA :
Public Declare Function my_compress Lib "D:\Freelancer\acc_image\cpp01\Debug\[login to view URL]" (imgPath As String, imgNewPath As String, ByVal compressLevel As Long) As Integer
then:
Public Function CompressImage(imgPath As String, imgNewPath As String, compressLevel As Long) As Boolean
Dim result As Long
Dim i_local_Path As String
Dim i_local_NewPath As String
i_local_Path = StrConv(imgPath, vbUnicode)
i_local_NewPath = StrConv(imgNewPath, vbUnicode)
result = my_compress(i_local_Path, i_local_NewPath, compressLevel)
CompressImage = False
If result = 1 Then CompressImage = True
End Function
I have test it ; it is working ok ...
BEST WISHES ....