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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TImageEnMView Acquire Corruption
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Sidney Egnew

USA
55 Posts

Posted - Apr 28 2023 :  10:25:06  Show Profile  Reply
I have a Fujitsu Scanner identified as PaperStream IP fi-8170 3.10 (32-32). I am using a TImageEnMView named MyMultiView to do the scanning. This works fine most of the time. There are times when the last pages in the multiview are corrupt, which happens when the number of pages is around 70 (front and back). It appears the component can't keep up with the scanner or exceeds the available memory.

The images are scanned in duplex mode, full color, at 300 DPI. Here are the issues observed when the problem occurred this morning.

1) The components' images were correct except for the final two physical pages (four pages in the component). Nothing was visible on the front or back of the next to last page, but there were blocks for the pages. The front of the last page was ok, but the back was just a block with no content.

We repeated several times, and the last two pages always have problems, but the corruption may change.

2) We can save the scan as a TIFF file. When we reload, everything is ok most of the time. But sometimes, most of the images are corrupt when reloading. Nothing can be done to fix them when that occurs.

3) One time, the save dialog was corrupted. We couldn't save the scanned images to a file. I had to kill the process.

On that run, all images were showing correctly in the component, but we could not save to see if the file was correct.

The acquisition code is shown below. Please advise.

Thanks


procedure TfmIndigoScan.OnAcquireClick(Sender: TObject);
begin
  with MyMultiView.MIO do
  begin
    if SelectAcquireSource([ieaTwain]) then
      if SelectedAcquireSource.API = ieaTwain then
        begin
          AcquireParams.YResolution := 300;
          AcquireParams.XResolution := 300;
          AcquireParams.DuplexEnabled := True;
          Acquire();
        end
      else
        ShowMessage('You must select a Twain Scanner');
  end;

Sidney Egnew

USA
55 Posts

Posted - May 01 2023 :  09:11:12  Show Profile  Reply
I don't know if the issue is fixed, but I added this code and got a good scan on the file we have been testing with. The only thing I see here that may have helped is the BufferedTransfer code.


  with MyMultiView.MIO.TwainParams do
  begin
    AutoDiscardBlankPages := Twain_AutoDiscard_Disable;
    XResolution.CurrentValue := 300;
    YResolution.CurrentValue := 300;
    BufferedTransfer := True;
    VisibleDialog := True;
    Update;
  end;
Go to Top of Page

xequte

38611 Posts

Posted - May 01 2023 :  19:13:42  Show Profile  Reply
Thanks Sidney, we will investigate this shortly.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Sidney Egnew

USA
55 Posts

Posted - May 02 2023 :  09:24:40  Show Profile  Reply
We did more testing. The ImageENMMView always says the image count is 70. However, we manually moved through the pages one at a time from the first page to the last. It turns out that the last four images (two physical pages) were just blocks in the ImageEnMView with no content. This matches the error we are seeing in the image processing software.

The saved file is uploaded to a server for processing. The image processing software extracts barcodes, MICR, and other data. When it gets to the problem images, the exception is "Bitmap not available." The image count is what we expect, but some of the pages don't have a bitmap. That appears to be what the empty blocks are.

We have scanned many other batches without issue. But this one fails every time. It has a 1/3 page header and 34 pages that are 8 1/2 by 11.
We scanned the batch several times today. We found the problem described above. On one run we saw three other pages (6 images) in the middle were blocks. On one run, the save dialog was corrupt.
Go to Top of Page

xequte

38611 Posts

Posted - May 02 2023 :  16:47:56  Show Profile  Reply
Hi Sidney

My partner agrees that it is a low memory problem. Either with system RAM or hard disk space:
- TImageEnMView may be trying to cache images and there is not enough disk space free
- If RAM is low various operations may fail

Are you using a 64 bit OS? And is the app 32 or 64bit?


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Sidney Egnew

USA
55 Posts

Posted - May 03 2023 :  08:34:18  Show Profile  Reply
I don't see any of the issues you mentioned as a problem.
Scanner: Fujitsu fi-8170
The program is 32-bit, but I can compile it 64-bit.

Here are the original computer specifications:
Free Disk Space = 434 GB
Intel i7-10700 CPU @ 2.90 GHz
16.0 GB (15.7 GB Usable)
64-bit operating system, x64-based processor
Windows 10 Pro - All Updates Installed

I moved the scanner to a second computer
Free Disk Space = 415 GB
Intel i7-4770K CPU @ 3.50 GHz
16.0 GB (15.9 GB Usable)
64-bit operating system, x64-based processor
Windows 10 Pro - All Updates Installed

The problem was present on both computers. I only ran the scan once on the second computer. The last page was just a block with no bitmap. The standard Delphi Save Dialog was corrupt, and the images could not be saved. I had to kill the program with the task manager. I asked for a different scanner to test that, but this seems to be an application issue.


Go to Top of Page

Sidney Egnew

USA
55 Posts

Posted - May 03 2023 :  09:49:08  Show Profile  Reply
I installed a Canon DR-M160II scanner and scanned the same document. This is a much slower scanner. It scanned all the pages, and everything looked good in the ImageEnMView. However, when saved and reloaded the images are not the same.

This is similar to the problem with the Fujitsu scanner. Here are the results for two scanning tasks using the same pages:

1) Images appear correct after scanning. Saved File. Opened File. Error: The last two images are blank bitmaps. All other images appear correct.

2) Images appear correct after scanning. Deleted the last page, two images. Saved File. Opened file. The images at the beginning are all messed up. See the image below. Images 48 thru 70 are correct. The deleted images are gone as expected.

Acquire Code

    if SelectAcquireSource([ieaTwain]) then
      if SelectedAcquireSource.API = ieaTwain then
        begin
          AcquireParams.YResolution := 300;
          AcquireParams.XResolution := 300;
          AcquireParams.DuplexEnabled := True;
          SetTwainParameters;
          Acquire();
        end


Set Twain Parameters Code

  with MyMultiView.MIO.TwainParams do
  begin
    AutoDiscardBlankPages := Twain_AutoDiscard_Disable;
    XResolution.CurrentValue := 300;
    YResolution.CurrentValue := 300;
    BufferedTransfer := True;
    VisibleDialog := True;
    Update;
  end;


Save Code

        MyMultiView.MIO.SaveToFileTIFF(FileName);


Open File Code

        MyMultiView.LoadFromFileOnDemand(FileName);


Delete Image Code

  with MyMultiView do
  begin
    v_SelectedImage := SelectedImage;
    if Odd(v_SelectedImage) then
      ShowMessage('You must select an image on the left.')
    else
      begin
        if v_SelectedImage >= ImageCount then
          ShowMessage('Invalid selection')
        else
          begin
            DeleteImage(v_SelectedImage+1);
            DeleteImage(v_SelectedImage);
          end;
      end;
  end;


Go to Top of Page

Sidney Egnew

USA
55 Posts

Posted - May 03 2023 :  10:54:47  Show Profile  Reply
I went one step further and changed the color setting on the Fujitsu scanner. I changed the color setting from "Color" to "Automatically Color Detection - Black & White / Grayscale/ Color." This allowed the problem batch to process successfully.

The issue is not resolved since the ImageEnMView is not working correctly with our normal color setting.
Go to Top of Page

xequte

38611 Posts

Posted - May 07 2023 :  21:16:52  Show Profile  Reply
Hi Sidney

I'm sorry we haven't been able to find a specific solution to you here. It is memory related, but assuming sufficient disk space and typical memory availability it should handle it better.

I presume it is not possible to make a demo that reproduces the issue (e.g. by filling a TImageEnMView with a selection of files loaded from the system). Personally I don't think it will fail in that scenario because the issue will not arise without the Fujitsu driver as part of the mix.

An alternative acquisition method for you would be to use the OnAcquireBitmap event and save the image immediately rather than adding it to the TImageEnMView:

http://www.imageen.com/help/TImageEnMIO.OnAcquireBitmap.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: