Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "KOL";
Текущий архив: 2009.07.26;
Скачать: [xml.tar.bz2];

Вниз

Error with CxKOLTiffJpg   Найти похожие ветки 

 
Jon ©   (2008-02-21 07:02) [0]

I have a problem with CxKOLTiffJpg.
Code stripped for ease of testing:

program Test;

uses
 KOL, KOLJpeg;

begin
 Applet := NewForm(nil,"Test JPEG");
 with NewJpeg^ do
 begin
   LoadFromFile("Test.jpg");
 end;
 Run(Applet);
end.


Above code produces a runtime error.
Test.jpg exists and is a valid jpg image,
Any advice?


 
Сидор   (2008-02-21 12:52) [1]

Why can"t you write simply:
program Test;

uses
KOL, KOLJpeg;

var Jpeg: TKOLJpeg;

begin
Applet := NewForm(nil,"Test JPEG");
Jpeg:=NewKOLJpeg;
Jpeg.LoadFromFile("Test.jpg");
Run(Applet);
end.


 
Jon ©   (2008-02-21 16:06) [2]

The code is the same, just a different way of writing it. Same result:

program Test;

uses
 KOL, KOLJpeg;

var
 JPEG: PKOLJpeg;

begin
 Applet := NewForm(nil,"Test JPEG");
 JPEG := NewJpeg;
 JPEG.LoadFromFile("Test.jpg");
 Run(Applet);
end.


When I try to do anything with the object there is the "Runtime Error".


 
Jon ©   (2008-02-21 16:44) [3]

I have the same problem when I try to compile the demo (KOLJpegDemo_.zip) included with CxKOLTiffJpg.zip - runtime error at LoadFromFile


 
Vladimir Kladov ©   (2008-02-21 20:27) [4]

program Cx;

uses
 KOL, KOLJpeg, err;

var J: PKOLJpeg;
begin
   J := NewJpeg( );
   J.LoadFromFile( GetStartDir+"001.jpg" );
   J.DIBNeeded;
   J.Bitmap.SaveToFile( GetStartDir+"001.bmp" );
   J.Free;
end.


Just tested, all works properly.


 
Jon ©   (2008-02-21 21:51) [5]

Tried your code but still does not work here.
Do you have any compiler options set?
I have to use conditional define "TESTING" for compile to work.
Problem is always on LoadFromFile.
More specifically it fails with LoadFromStream.
As tested here:

program Test;

uses
 KOL, KOLJpeg, err;

var
 J: PKOLJpeg;
 B: PBitmap;
 S: PStream;

begin
 S := NewMemoryStream;
 B := NewBitmap(100,100);
 B.SaveToStream(S);
 B.Free;
 J := NewJpeg;
 J.LoadFromStream(S);  // <--- error here
 S.Free;
 J.SaveToFile("test.jpg");
 J.Free;
end.


 
Jon ©   (2008-02-21 22:10) [6]

Sorry, I posted wrong code:

program Test;

uses
 KOL, KOLJpeg, err;

var
 J: PKOLJpeg;
 S: PStream;

begin
 S := NewReadFileStream("test.jpg");
 J := NewJpeg;
 J.LoadFromStream(S);  // <--- error here
 S.Free;
 J.DIBNeeded;
 J.Bitmap.SaveToFile("test.jpg");
 J.Free;
end.


 
Vladimir Kladov ©   (2008-02-22 15:14) [7]

ADDITIONAL_USES


 
Jon! ©   (2008-02-22 16:28) [8]

Here too. My complete list: KOL_MCK;ADDITIONAL_USES;TESTING;

I shall try installing Delphi and KOL on another machine and check results...


 
Vladimir Kladov ©   (2008-02-23 11:58) [9]

TESTING not needed, only ADDITIONAL_USES.
GetStartDir may be solve your problem.


 
Jon ©   (2008-02-24 01:58) [10]

I removed TESTING.
Added and checked GetStartDir (MsgOk...).
Tried on different machine too.
Still same problem - error at LoadFromFile/Stream.
Any other suggestions?


 
Jon ©   (2008-02-24 01:59) [11]

I removed TESTING.
Added and checked GetStartDir (MsgOk...).
Tried on different machine too.
Still same problem - error at LoadFromFile/Stream.
Any other suggestions?


 
Vladimir Kladov ©   (2008-02-24 11:27) [12]

I suppose that just file was not found, so full path must be specified.


 
Jon ©   (2008-02-24 15:49) [13]

Full path is specified but error occurs.
If file is not found, no error is produced.
I trace error into assembly area but do not understand it.
Line where error occurs is:
     j__jpeg_read_header( Integer( @ cinfo ), {require_imaged=}Integer( TRUE ) );
KOLJpeg.pas line 1611.


 
Vladimir Kladov ©   (2008-02-24 17:42) [14]

may be image is not jpeg? Is it opening with JpegObj?


 
Jon ©   (2008-02-24 19:11) [15]

Yes, I have a small project using JpegObg which works fine.
I am attempting to transfer to CxKOLTiffJpg because of large images.
All my tests are with small simple jpeg images which work.
Sorry if I am being a nuisance.



Страницы: 1 вся ветка

Форум: "KOL";
Текущий архив: 2009.07.26;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.47 MB
Время: 0.01 c
15-1242854996
Германн
2009-05-21 01:29
2009.07.26
Поздравляю Шахтёр!


15-1243370399
Petr V. Abramov
2009-05-27 00:39
2009.07.26
Насчет конференции («Начинающим»)


15-1242811594
DillerXX
2009-05-20 13:26
2009.07.26
Подскажите аудио-битрейт-ченджер


2-1244032588
Pavlov
2009-06-03 16:36
2009.07.26
try except


2-1243960373
v1kee
2009-06-02 20:32
2009.07.26
Помогите с динамическим созданием строк





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский