[img]Converting JPG to BMP fails with some JPG.[/img]
Posted: Fri May 02, 2003 1:19 pm
I do not know if it's a bug or my mistake.
My program :
------------------------------------------------
UseJPEGImageDecoder()
GImage$ = "Dscn2727_recadre.jpg"
; GImage$ = "_affiche2721.jpg"
If LoadImage(0, GImage$) = 0
GLiberr$ = "Error reading " + GImage$
Else
imagebmp$ = "Wallpaperjc_tmp.bmp"
If SaveImage(0, imagebmp$, #PB_ImagePlugin_BMP) = 0
GLiberr$ = "Error writing from " + GImage$ + " to " + imagebmp$
Else
MessageRequester("","Good",0)
EndIf
EndIf
If GLiberr$ <> ""
MessageRequester("",GLiberr$,0)
EndIf
End
-------------------------------------------------
Generally, it works fine. But sometimes, a JPEG file makes the Saveimage fail. About 5 or 10 %.
These JPEG files are all made with a CoolPix 990, then worked with Ulead PhotoImpact 3.01, with "JPEG SmartSaver".
I select 2 cases : Dscn2727_recadre.jpg (saveimage fails) and _affiche2721.jpg (no problem).
You can find these pictures and the code at :
http://pg.ctjean.com/testpb/
Desactivate Debugger before F5. Sometimes, it halts.
Thanks if you find an explanation.
Jean.
My program :
------------------------------------------------
UseJPEGImageDecoder()
GImage$ = "Dscn2727_recadre.jpg"
; GImage$ = "_affiche2721.jpg"
If LoadImage(0, GImage$) = 0
GLiberr$ = "Error reading " + GImage$
Else
imagebmp$ = "Wallpaperjc_tmp.bmp"
If SaveImage(0, imagebmp$, #PB_ImagePlugin_BMP) = 0
GLiberr$ = "Error writing from " + GImage$ + " to " + imagebmp$
Else
MessageRequester("","Good",0)
EndIf
EndIf
If GLiberr$ <> ""
MessageRequester("",GLiberr$,0)
EndIf
End
-------------------------------------------------
Generally, it works fine. But sometimes, a JPEG file makes the Saveimage fail. About 5 or 10 %.
These JPEG files are all made with a CoolPix 990, then worked with Ulead PhotoImpact 3.01, with "JPEG SmartSaver".
I select 2 cases : Dscn2727_recadre.jpg (saveimage fails) and _affiche2721.jpg (no problem).
You can find these pictures and the code at :
http://pg.ctjean.com/testpb/
Desactivate Debugger before F5. Sometimes, it halts.
Thanks if you find an explanation.
Jean.