RomainR Posted October 13, 2009 Posted October 13, 2009 Hi all, I discovered your forum from the french AutoIt community. First of all I would like to thank all the submitters of this topic http://www.autoitscript.com/forum/index.php?showtopic=92795 for the function "SimpleTesseract.au3" (Tesseract is an open source OCR) which is very usefull for me Here is my problem: I need to use the function simpletesseract several times and on a quite large resolution in the same script. After using it more than 40 times, I get the following error message: "_WinAPI_CreateCompatibleBitmap : Espace insuffisant pour traiter cette commande" It is in french but the transalation would be something like: "_WinAPI_CreateCompatibleBitmap: Insufficient space to treat the command" There must be some kind of leak in the function. I tried this: #include <SimpleTesseract.au3> $Temp = 1 While $Temp < 45 _TesseractScreenCapture(0,"",1,3,0,0,1024,768,0) $Temp = $Temp + 1 WEnd And I get the same error message... I'm not an expert and I really don't how I can solve this issue but there must be something to destroy at the end of the function or something like that? Any help appreciated Here is the source of the tesseract function: http://www.autoitscript.com/forum/index.php?app=core&module=attach§ion=attach&attach_id=25714 PS: sorry if my english is not that good but it's well known that french are bad at speaking foreign languages!
JohnOne Posted October 13, 2009 Posted October 13, 2009 The error seems to indicate that the temp path you set, does not have enough disk space, but I see you set it to cleanup, bit puzzling. Are you storing the images anywhere as variables, in an array or something ? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
RomainR Posted October 14, 2009 Author Posted October 14, 2009 Hi JohnOne and thanks for your reply.I think the problem does not come from disk space because I've got something like 16Go free space on C: and 35Go on D: so I should be enough... However, I tried to change the temporary path defined in the SimpleTessarct function ($tesseract_temp_path = D:\Temp\ instead of C:\ ) but I still get the same error message.Are you storing the images anywhere as variables, in an array or something ?No I don't. As you can see on the simple script in my first post, I do not store the images anywhere. But maybe the tesseract function does it itself? The problem is that I don't understand whole behaviour the function because it is far too complicated according to my knowledges... I guess it may be related to virtual memory or stuff like that.Any other idea?
water Posted October 14, 2009 Posted October 14, 2009 Could you try to insert a Sleep function after every screencapture? I once had a similar problem with Active Directory that was solved this way: #include <SimpleTesseract.au3> $Temp = 1 While $Temp < 45 _TesseractScreenCapture(0,"",1,3,0,0,1024,768,0) $Temp = $Temp + 1 Sleep(1000) WEnd Another idea: Have you checked that the Variable $Temp isn't used by Tesseract as well? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
RomainR Posted October 14, 2009 Author Posted October 14, 2009 I tried the script you submitted with a sleeping time of 5 seconds: Sleep(5000) but the issue remains I also checked the Tesseract script and the var $Temp is not used in the function (only $tesseract_temp_path and $temp_path are used). I performed some tests using "process explorer" and I observed a leak in "GDI objects" while my script was running. I'm almost sure that the problem comes from something (an object, an array or a simple variable maybe) which is not totally destroyed and rebuilt each time the function _TesseractScreenCapture is called. But I can't find out which one...
dcat127 Posted December 22, 2011 Posted December 22, 2011 I had the same problem, and am posting the solution that I found: $hBitmap2 is not being released. I added _WinAPI_DeleteObject ($hBitmap2) down at the bottom where the other things are being released. (around line 1000) of tesseract.au3
Moderators Melba23 Posted December 22, 2011 Moderators Posted December 22, 2011 dcat127, I would also post this in the Tesseract thread itself. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
superboss Posted January 3, 2012 Posted January 3, 2012 Perfect. Thanks very much for this post and solution. No idea why this wasnt identified earlier. The Teeeract.au3 file should be fixed asap.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now