ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Error: MIO.Acquire and FastMM

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
madas Posted - Dec 11 2017 : 10:02:10
Hi,

I am getting the following error from FastMM when I try to scan TIF-files via TImageEnMView. Delphi 2009, FastMM 4.991 und ImageEn 7.0.0.1



stacklist:


Fehlermeldung:
Zu wenig Arbeitsspeicher
--------------------------------------------------------------------------
--
Exception class: EOutOfMemory
Exception Adresse: 00404A93
--------------------------------------------------------------------------
--
Stackliste, generiert 11.12.2017 16:00:29 [00404A8E] System.TObject.NewInstance + $A [00403756] System.ErrorAt + $16 [00404A8E] System.TObject.NewInstance + $A [00404FDF] System.@ClassCreate + $7 [00A40552] iexBitmaps.TIOParams.Create (Line 42125, "iexBitmaps.pas" + 0)
+ $A
[00A47C8B] iexBitmaps.TIOMultiParams.CheckAllocated (Line 50603, "iexBitmaps.pas" + 4) + $9 [00A47F3C] iexBitmaps.TIOMultiParams.GetParams (Line 50699, "iexBitmaps.pas" + 4) + $4 [00991B0D] iemio.TImageEnMIO.LoadFromStreamTIFF (Line 1645, "iemio.pas" +
19) + $C
[00436B5D] Classes.THandleStream.Create + $19 [0040504D] System.@AfterConstruction + $1D [009919F0] iemio.TImageEnMIO.LoadFromFileTIFF (Line 1596, "iemio.pas" + 5)
+ $6
[009925F1] iemio.TImageEnMIO.LoadFromFile (Line 2140, "iemio.pas" + 27) +
$5
[00992453] iemio.TImageEnMIO.LoadFromFile (Line 2099, "iemio.pas" + 22) +
$6



I am using the following code:


unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, hyieutils, iexBitmaps, hyiedefs, iesettings, iexLayers, iexRulers, StdCtrls, ieview, iemview, fraImageIE,
  FileCtrl, ComCtrls;

type
  TForm2 = class(TForm)
    Button1: TButton;
    FrameImgIE1: TFrameImgIE;
    ListView1: TListView;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure ListView1SelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
  private
    currCount: Integer;
    procedure ImageEnMView1AfterAcquireBitmap(Sender: TObject; index: Integer);
  public
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Button1Click(Sender: TObject);
begin
  currCount := 0;
  with FrameImgIE1.ImagePreview.MIO do
  begin
    TwainParams.ShowSettingsOnly   := False;
    TwainParams.ProgressIndicators := False;
    TwainParams.VisibleDialog      := false;
    TwainParams.FeederEnabled      := true;
    Acquire;
  end;
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
  FrameImgIE1.ImagePreview.MIO.OnAfterAcquireBitmap := ImageEnMView1AfterAcquireBitmap;
end;

procedure TForm2.ImageEnMView1AfterAcquireBitmap(Sender: TObject; index: Integer);
var
  item: TListItem;
begin
  Inc(currCount);
  ListView1.AddItem('D:\tempImage_' + Format('%.3d', [currCount]) + '.tif', nil);
  item := ListView1.Items[ListView1.Items.Count - 1];
  FrameImgIE1.ImagePreview.MIO.Params[index].TIFF_Compression := ioTIFF_G4FAX;
  FrameImgIE1.ImagePreview.MIO.Params[index].BitsPerSample := 1;
  FrameImgIE1.ImagePreview.MIO.Params[index].SamplesPerPixel := 1;
  FrameImgIE1.ImagePreview.MIO.SaveToFileTIFF(item.Caption);
  FrameImgIE1.ImagePreview.Clear;
end;

procedure TForm2.ListView1SelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
begin
  FrameImgIE1.LoadImage(Item.Caption);
end;

end.


If I comment out the FastMM unit then all seems to work correctly.

Any clue on this error???

Greetings.

madas
7   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Dec 14 2017 : 17:42:25
Hi Madas

So, to clarify, it works correctly with the newer version of FastMM?

Nigel
Xequte Software
www.imageen.com
madas Posted - Dec 12 2017 : 02:15:36
More research:

The error is caused by the fulldebugmode of FastMM. I have no idea why?.

greetings.

madas
madas Posted - Dec 12 2017 : 02:01:14
Hi Nigel,

I was assuming the latest version of FastMM was the 4.991. I had another search for the project homepage and found that it was moved the github instead of sourceforge. At github there was a newer version 4.992 which resolved the problem for me.

greetings.

madas
madas Posted - Dec 12 2017 : 01:41:49
Attached please find the test project.

attach/madas/2017121214131_MioLoadErrorTest.zip
348 KB

The exception dialog component is not include. So has to be removed from the form.
madas Posted - Dec 12 2017 : 01:38:17
The stacktrace above is from an exception I getting after clicking on the first created listview item.
madas Posted - Dec 12 2017 : 01:36:07
Hi Nigel,

the scan process ends at the end of the first page and no other page is scaned. For what I could find all went well until the code is reaching line 2051 of the unit imscan.pas


if IOParams <> nil then
      begin
        case twImageInfo.BitsPerPixel of
          1..8:
            begin
              IOParams.BitsPerSample := twImageInfo.BitsPerPixel;
              IOParams.SamplesPerPixel := 1;
            end;
          24:
            begin
              IOParams.BitsPerSample := 8;
              IOParams.SamplesPerPixel := 3;
            end;
        end;
        IOParams.DpiX := ImDpiX;
        IOParams.DpiY := ImDpiY;
        IOParams.Width := twImageInfo.ImageWidth;
        IOParams.Height := twImageInfo.ImageLength;
        IOParams.OriginalWidth := twImageInfo.ImageWidth;
        IOParams.OriginalHeight := twImageInfo.ImageLength;
        IOParams.FreeColorMap;
        IOParams.FileName := fCaption;
      end;


Hope this helps.

madas
xequte Posted - Dec 11 2017 : 13:29:17
Hi Madas

On what line does it occur in your source (or is it after the end of ImageEnMView1AfterAcquireBitmap)?

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com