Hi All. does anyone have any code that converts a webp image to jpg. i have used freeimage.dll ver 3.18 and MFreeImage ver 2.24 and strangely one time it works and then the next it doesn't on the same image.
i am trying to use.
Code:dib = FreeImage_LoadEx(Source, FILO_LOAD_DEFAULT, 300, 450) bOK = FreeImage_Save(FIF_JPEG, dib, Destination, 0) ' Unload the dib FreeImage_Unload (dib)
or this
I am downloading images from trakt and then want to convert to jpg and resize to show in a picture box.Code:Public Function ConvertWebPToJPG2(webpFile As String, jpgFile As String) As Boolean Dim dib As Long Dim Success As Long ' Initialize FreeImage FreeImage_Initialise True ' Load WebP image dib = FreeImage_Load(FIF_WEBP, webpFile, 0) If dib = 0 Then MsgBox "Failed to load WebP image!" FreeImage_DeInitialise ConvertWebPToJPG2 = False Exit Function End If ' Save as JPG Success = FreeImage_Save(FIF_JPEG, dib, jpgFile, 0) ' Free resources FreeImage_Unload dib FreeImage_DeInitialise ConvertWebPToJPG2 = (Success <> 0) End Function
i just need something 100% everytime.
thanks




Reply With Quote