Board index » delphi » EJPEG
Jose
Delphi Developer |
EJPEG2003-12-23 04:05:23 PM delphi261 hi, i want to change the format of a JPEG file to Bitmap, so I have used the following code: (if there is another way to do so that is better that this one, please let me know too) // ext: string ext := LowerCase(ExtractFileExt(SourceFName)); if (ext = '.jpg') or (ext = '.jpeg') or (ext = '.jpe') or (ext = '.jfif') then begin bmp := TBitmap.Create(); //bmp: TBitmap jpg := TJPEGImage.Create(); //jpg: TJPegImage try jpg.LoadFromFile(SourceFName); bmp.Assign(jpg); bmp.SaveToFile(DestinationFName); finally bmp.Free(); jpg.Free(); end; end; it should work ok. but on Win98 when i test it, sometimes an error message will be displayed as follow: Exception EJPEG in module ... at address ... JPEG error #53. when i tested it on WinXP, the error message wasn't be displayed. also I am sure that all the JPEG files that I have sent to this procedure are valid JPEG files that are opened successfully with all picture viewers such as MSPaint. do you know what is the problem and how can i get rid of it? thanks a lot, Jose |