http://gambaswiki.org/bugtracker/edit?object=BUG.1044&from=L21haW4-
Comment #5 by Antonio OREFICE: The example provided by Fabien does indeed reproduce the "bug", but i made another one, attached. I also noticed that with gb.gtk it does (prints "image is corrupted"), while gb.qt4 and gb.qt5 always print "Image is fine" Public Sub Form_Open() Dim hFile As File Dim mydata As Byte[] Dim sFileName As String = "/tmp/image.jpg" Dim img As New Image(640, 480, Color.black) 'make a black image Dim i As Long Dim bByte As Byte Dim bBytes As New Byte[] Dim iLen As Long img.Save(sFileName) 'save it to disk hFile = Open sFileName For Read iLen = Stat(sFileName).Size For i = 0 To iLen - 1 'read the image file in memory Read #hFile, bByte bBytes.Add(bByte) Next 'i hFile.Close() Kill sFileName 'delete the image file hFile = Open sFileName For Read Write Create For i = 0 To ((iLen - 1) Div 2) 'write it to disk again, but only the first half Write #hFile, bBytes[i] As Byte Next 'i hFile.Close() Try img = Image.Load(sFileName) 'try to load the corrupted image If Error Then Print "Image is corrupted" '<--- this is printed with gtk2 and gtk3 Else Print "Image is fine" '<--- this is printed with qt4 and qt5 Endif End ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user