Image Library Error

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Giles.Buist
Newbie
Posts: 15
Joined: Wed Feb 15, 2006 2:25 pm
Location: London

Image Library Error

Post by Giles.Buist » Thu Feb 23, 2006 11:25 am

Hi,

I Have just installed both Macro Scheduler and the Image Library on a new computer. I have also copied and pasted my working scripts to the new computer, but now they don't work. Whilst in a bit of code that uses image recognition I get this error:

"Exception EInvalidGraphicOperation in module imglib.dll at 0001584E"

How can I fix this please?

All help much appreciated

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 23, 2006 11:26 am

Can't possibly answer the question without seeing your script. Please post your code.

But the most possible cause is that the script is referencing an image file that doesn't exist.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Giles.Buist
Newbie
Posts: 15
Joined: Wed Feb 15, 2006 2:25 pm
Location: London

Post by Giles.Buist » Thu Feb 23, 2006 12:01 pm

The code:


Let>imglibDLL=C:\Program Files\Macro Scheduler Image Library\imglib.dll
LibLoad>imglibDll,imglib
Wait>DLA
ScreenCapture>708,679,764,699,C:\screen2.bmp
LibFunc>imglib,CompareBitmaps,match,C:\Close.bmp,C:\screen2.bmp
Wait>DLA
LibFree>imglib



Personally I felt the question didn't require code. It's an error produced by Macro Scehduler. Surely it refers to a particular situation.

On that note, perhaps you would consider being a little more polite in replies to posts. Your knowledge is good but your interpersonal skills are not.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 23, 2006 12:15 pm

I'm not sure what was rude about my answer - I was just asking for code (and I used the word "Please"!) - I'm afraid I cannot diagnose problems properly without seeing code, so I asked for code. I really am sorry if I somehow offended :-/

On to the problem in hand:

1) Does c:\Close.bmp exist? If it does not, and you have an early version of the library, you will get an error.

2) Have you stepped through with the debugger so that you can tell us which line the error occurs at? Open the script in the editor (please), place the cursor on the first line, hit F8. If you would be so kind, keep hitting F8 until the error occurs, and tell us which line it occurs on.

3) Have you the latest version of the Image Library - the latest version is more graceful with errors if a file does not exist. CompareBitmaps will return -1 if one of the files does not exist.

Please download the latest at:
http://www.mjtnet.com/imagerecognition.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Giles.Buist
Newbie
Posts: 15
Joined: Wed Feb 15, 2006 2:25 pm
Location: London

Post by Giles.Buist » Thu Feb 23, 2006 12:42 pm

The image file exists, and is in the location specified C:\

I downloaded the imglib.exe a few days ago, it is version 6.0.1.4

The error occurs on line:

LibFunc>imglib,CompareBitmaps,match,C:\Close.bmp,C:\screen2.bmp

CompareBitmaps can't return -1 because the script never gets that far.

Sometimes though not every time I also get an error saying:

"Access violation at address 00404DA0 in module 'msched.exe'. Read of address 00000000"

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 23, 2006 12:51 pm

Hmmm. Not sure what's going on here. Could you possibly send me an email with a copy of Close.bmp and your .scp file so that I can try to duplicate with the same image file? Could you also send screen2.bmp generated by the script. I can only imagine there must be something peculiar about Close.bmp but I may be wrong. Without Close.bmp I can't really say, so if you could send me it I should have a better idea of what's going on here.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 23, 2006 12:56 pm

I should say my best guess at the moment is that close.bmp is not a valid .bmp file. EInvalidGraphic means the image is not valid. So either it's not actually a bitmap file (maybe a jpeg instead) or it is corrupt.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Feb 23, 2006 2:48 pm

Welcome to the forum Giles.Buist

Since you are a recent participant you have no way of knowing how helpful Marcus is to users with all levels of experience. Asking for a sample of code to help understand certainly is not rude, and I have never seen any rudeness by him over the past many years I have been a user.

When you get a chance, go through some old postings from Marcus and you will see how accomodating he has been to everyone.

I also noted that his response was WITHIN ONE MINUTE of your posting. That quick response is very rare in most forums. How many other developers even bother to monitor the forums, much less respond to them.

Marcus will solve your problem, just work with him, and follow his guidelines as you have been doing so far.

I don't want to get into a debate about this, and Marcus certainly does not need any defense. Please take my comments as a friendly welcome from another end user, who is advising you of a pleasant experience here and with using Macro Scheduler.

Good luck in your projects.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Giles.Buist
Newbie
Posts: 15
Joined: Wed Feb 15, 2006 2:25 pm
Location: London

Post by Giles.Buist » Thu Feb 23, 2006 3:02 pm

Corrupt image file is probably right as have captured Close.bmp again on the new machine and have subsequently run the code successfully.

Thankyou for the help

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Feb 23, 2006 3:11 pm

You are welcome. I'm glad the problem is solved.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts