Buen día.
el problema se da cuando intento abrir la imagen capturada desde un celular y la quiero mostrar en otra aplicación.
con este codigo lo cargo al servidor ftp
Código Delphi
[-]
var FileName: string;
ms: TMemoryStream;
Surf: TBitmapSurface;
JpgQuality : TBitmapCodecSaveParams;
begin ms := TMemoryStream.Create;
try JpgQuality.Quality := 75;
Image1.Bitmap.Assign(Image);
try
Surf := TBitmapSurface.Create;
try
Surf.Assign(image);
if not TBitmapCodecManager.SaveToStream(MS, Surf, '.jpg', @JpgQuality)
then
raise EBitmapSavingFailed.Create('Error guardando imagen');
finally
Surf.Free;
end;
ms.Position := 0;
FTP.Host := 'direccion';
FTP.Username := 'fer';
FTP.Password := '**********';
FTP.Port := 33265;
FTP.Passive := false;
FTP.ConnectTimeout := 100;
FTP.Connect();
ms.Position := 0;
FTP.Put(ms, nombrefoto.Text + '.jpg');
finally
ms.Free;
end;
finally
FTP.Disconnect;
end;
y con este codigo intento mostrarlo en la otra aplicacion
Código Delphi
[-]
procedure LoadURLImage(Image: TImage; URL: String);
var
TempName: String;
begin TempName := 'temp' + ExtractFileExt(URL);
URLDownloadToFile(nil, PCHAR(URL), PCHAR(TempName), 0, nil);
if FileExists(TempName) = true then begin Image.Picture.LoadFromFile(TempName);
end else begin Image.Picture.LoadFromFile('C:\IMA\NO.JPG'); end; DeleteFile(TempName); application.ProcessMessages; end;
procedure TFOTOVEHICULOS.btmostarClick(Sender: TObject);
begin LoadURLImage(Image1,'direccion/380.jpg'); end;
pero al momento de ejecutar la accion solo dice jpeg error #53
la imagen se guarda correctamente en el servidor pero no se muestra
gracias por su ayuda