Hi .. I am trying to download images from various sites using Job.GetBitmap.
Occasionally , Even with Job.Success True there is a problem with the Bitmap
for example .. what appears to be a single pixel image .. http://aucdn.ar-cdn.com/recipes/default.jpg
I attempted using Try / Catch but have hit a snag.
Question : If there is an error thrown in the Try block , do subsequent lines still execute ?
Log() lines don't appear in logs but the variable counter nSuccess will continue to increase ?
Or is there a better way to catch a bad bitmap?
Many Thanks
Occasionally , Even with Job.Success True there is a problem with the Bitmap
for example .. what appears to be a single pixel image .. http://aucdn.ar-cdn.com/recipes/default.jpg
I attempted using Try / Catch but have hit a snag.
Question : If there is an error thrown in the Try block , do subsequent lines still execute ?
Log() lines don't appear in logs but the variable counter nSuccess will continue to increase ?
B4X:
If getImage.Success Then
Try
Dim imgThumb As ImageView
imgThumb.Initialize("imgThumb")
imgThumb.Bitmap = getImage.GetBitmap 'Error here on some bitmaps
Log($"Successfully Downloaded Bitmap # ${nSuccess}"$)
'@@@ This line still executes even with exception ? ? @@@
nSuccess = nSuccess + 1
Catch
Log($"An ERROR Occured ... current success tally = ${nSuccess}"$) 'File exists and downloaded OK .. But problem with Bitmap
End Try
Else
Log($"Image download NOT successful ... Image does not Exist"$) 'Error Responce 404 - File not Found
End If
getImage.Release
Or is there a better way to catch a bad bitmap?
Many Thanks
Last edited: