| Autor |
Beitrag |
matze
      
Beiträge: 4613
Erhaltene Danke: 24
XP home, prof
Delphi 2009 Prof,
|
Verfasst: Mi 03.11.04 13:01
Hallo !!
ich habe folgenden Code: Delphi-Quelltext 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19:
| try MS := TMemoryStream.Create; jpg := Tjpegimage.create; try IdHTTP1.Get(server+'screens/'+IP+'tmbn.jpg', MS); ms.Position := 0; try jpg.LoadFromStream (ms); image.Picture.Assign (jpg); image.Transparent := false; except end; except image.Picture.Assign (nopic_waiting.picture); end; finally ms.free; jpg.free; end; |
So das Problem ist, dass anscheinend machmal defekte Bilder vom Server kommen und ich dann einen Fehlermeldung auisgegeben bekomme. Die Lautet "JPG Fehler #41".
Was genau bedeutet dieser Fehler, und wie kann ich den haneln.
Der fehler tritt nicht immer auf, deswegen kann ich mich ach nciht mim debugger hinsetzte und schauen, welche funktion den fehler auslößt.
_________________ In the beginning was the word.
And the word was content-type: text/plain.
|
|
DaRkFiRe
      
Beiträge: 526
WinXP Home & Professional
C, C++, Delphi
|
Verfasst: Mi 03.11.04 23:27
imho tritt der fehler immer bei einer fehlerhaften jpeg datei auf
_________________ Lang ist der Weg durch Lehren - kurz und wirksam durch Beispiele! Seneca
|
|
matze 
      
Beiträge: 4613
Erhaltene Danke: 24
XP home, prof
Delphi 2009 Prof,
|
Verfasst: Do 04.11.04 11:57
jo aber wie kann ich den denn abfangen ??
mein problem ist, dass der code von aben in einem timer läuft, dass hiesst es sit nciht schlimmm, wenn das JPG mal nicht geladen wird, es sollte nur keine fehlermeldung kommen !!!
_________________ In the beginning was the word.
And the word was content-type: text/plain.
|
|
BenBE
      
Beiträge: 8721
Erhaltene Danke: 191
Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
|
Verfasst: Do 04.11.04 19:39
Nutze dafür Try-Except-Blöcke. Allerdings meldet dir die Delphi-IDE den Fehler trotzdem. Wenn das Programm aber ohne IDE läuft, merkt der User nichts.
_________________ Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
|
|
matze 
      
Beiträge: 4613
Erhaltene Danke: 24
XP home, prof
Delphi 2009 Prof,
|
Verfasst: Fr 05.11.04 14:12
ich habe oben in den code ja einen tray except block um die fnunctions die mit dem JPG zu tun haben geschrieben. leider hilft das nix. wenn das programm normal, also ausserhalb der IDE läuft, kommen diese fehler leider auch !
_________________ In the beginning was the word.
And the word was content-type: text/plain.
|
|
BenBE
      
Beiträge: 8721
Erhaltene Danke: 191
Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
|
Verfasst: Fr 05.11.04 23:15
Das innere Try-Except kannst du IMHO weglassen (da wo nix im Except-Teil drin steht).
Bei den Ressource-Schutzblöcken musst du darauf achten, dass du MS und JPG jeweils in einen eigenen Try-Finally-Block legen solltest.
Formatiere mal deinen Code nach dem Borland Coding Style oder Econos-Standard. Ansonsten krieg ich noch Augenkrebs.
_________________ Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
|
|
matze 
      
Beiträge: 4613
Erhaltene Danke: 24
XP home, prof
Delphi 2009 Prof,
|
Verfasst: Sa 06.11.04 11:34
hä ?? wie meinst du das ?
schrieb den meinen code so um wie du das meinst.
und was sind das denn für sandards ?
_________________ In the beginning was the word.
And the word was content-type: text/plain.
|
|
AXMD
      
Beiträge: 4006
Erhaltene Danke: 7
Windows 10 64 bit
C# (Visual Studio 2019 Express)
|
Verfasst: Sa 06.11.04 11:55
| BenBE hat folgendes geschrieben: | | Ansonsten krieg ich noch Augenkrebs. |
Oh mein Gott, ich bin blind
AXMD
|
|
BenBE
      
Beiträge: 8721
Erhaltene Danke: 191
Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
|
Verfasst: Sa 06.11.04 17:13
@Standards: Das sind die Richtlinien, nach denen die VCL Quelltexte formatiert sind (Borland Coding Style) bzw. die Omorphia-Bibliothek (Econos Coding Standard). Geht einfach besser zu lesen als sowas Hingeklatschtes mit haufen Leerzeichen.
_________________ Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
|
|
matze 
      
Beiträge: 4613
Erhaltene Danke: 24
XP home, prof
Delphi 2009 Prof,
|
Verfasst: So 07.11.04 17:16
ja das ist zwar schön und gut, hilft mir bei meinem problem auf nicht weiter !!
was meintest du denn mit den try except oder try finally blöcken ?
_________________ In the beginning was the word.
And the word was content-type: text/plain.
|
|
BenBE
      
Beiträge: 8721
Erhaltene Danke: 191
Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
|
Verfasst: So 07.11.04 18:48
Ich mein damit, dass du Zeile 7, 11 und 12 aus dem Source nehmen sollst.
Mehr Infos zu Try-Except finden sich in der DOH.
_________________ Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
|
|
matze 
      
Beiträge: 4613
Erhaltene Danke: 24
XP home, prof
Delphi 2009 Prof,
|
Verfasst: Mo 08.11.04 13:47
also was try exept blocke weis ich schon !!
aber es hilft mir auch nix, wenn ich diese zeilen ruasnehme ! das problem besteht weiterhin und es kommt immernoch diese fehlermeldung !
_________________ In the beginning was the word.
And the word was content-type: text/plain.
|
|
matze 
      
Beiträge: 4613
Erhaltene Danke: 24
XP home, prof
Delphi 2009 Prof,
|
Verfasst: Sa 13.11.04 11:25
also so richtig kann mir keiner helfen oder ?
_________________ In the beginning was the word.
And the word was content-type: text/plain.
|
|