It's possible to create the crash in two ways: By using a combination of image decoders and by corrupting the image.
Anyway I learned to post it in the discussion first because maybe I mixed something up again.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
#File = "d:\image.jpg" ; I'm using this: http://em.q-soft.ch/filestore/a4/hyrC4BGV1j.image.jpg._
; Insert those lines to get the 2. crash
UseJPEGImageDecoder()
UsePNGImageDecoder()
UseTGAImageDecoder()
UseJPEG2000ImageDecoder()
; Make a backup
CopyFile(#File, #File + ".bak")
; Load normal image
ImageID = LoadImage(#PB_Any, #File) ; <- 1. Crash: "Read error at address 12813"
If ImageID <> 0
FreeImage(ImageID)
Debug "Load normal - Ok"
Else
Debug "Load normal - Error"
EndIf
DeleteFile(#File)
RenameFile(#File + ".bak", #File)
Your first crash is caused by the decoder not being loaded, the second because you deliberately corrupt the file. With the correct decoder loaded, regardless of how many other decoders are loaded as well, the program works fine. The "crashes" are only debugger stops, if you run without debugger there is no crash, it just doesn't work. All this is to be expected.
netmaestro wrote:Your first crash is caused by the decoder not being loaded, the second because you deliberately corrupt the file. With the correct decoder loaded, regardless of how many other decoders are loaded as well, the program works fine. The "crashes" are only debugger stops, if you run without debugger there is no crash, it just doesn't work. All this is to be expected.
That's the point: It isn't a debugger stop. The executable immediately closes itself so as I wrote in my example code you won't come to the backup.
Sorry but did you even tried the code with this image?
If the image is corrupt I should get a #False return value but not a complete crash.
Also I don't understand why I should get a warning if one image decoder isn't loaded. Just comment every decoder out and no compiler warning is comming as expected but a #False return value...
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Sorry, for being harsh but you know...I spend the whole day searching for the cause. And to me it looks like a bigger problem... So overall I'm getting a bit upset.
Edit:
Should I create a new message in the bug forum?
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!