Comments (9)
Fixed by af2bca4 44a25c8 and 2fbc4fe.
from imageput.
Is there a typo in your copy of ImagePut?
Line 1362 should read GlobalLock, not GlobalAlloc.
See:
Line 1362 in 4479b84
from imageput.
Sorry, that's a typo in the topic, the file is correct! Going to edit it!
from imageput.
Can you check for a memory leak? It looks like one to me. See how much memory AutoHotkey is using in task manager - it should be stable.
Also can you post the full code? Are you deleting 'img'?
from imageput.
Also,
ImagePutBuffer("window")
is ambiguous syntax try:
ImagePutBuffer({window: "MyTitle"})
to avoid the bug where a file name has the same name as a window
from imageput.
Can you check for a memory leak?
It increased 10MB in the last 3 minutes, I'm going to keep an eye on it. I had discarded this possibility earlier because when I got a leak in the past it would crash very early. EDIT: look's like a leak, it increased 30MB since writting this post.
Are you deleting 'img'?
I'm not deleting image. I thought it was not needed because it's inside a class method.
Also can you post the full code?
Sure: script.zip
I'm going to try deleting 'img' and every related object. I just need img := ""
, right?
Thanks!
from imageput.
Well this doesn't look like an ImagePut error.
Try to improve your memory management:
fn(img) {
filepath := "something.png"
static search := Imageputbuffer(filepath)
img.imagesearch(search)
}
Make the search images static so you don't create a million of them. Then I see you're storing the screen capture in an array, you'll need to do arr[123] := "" to delete them. (Don't bother deleting static images they will be cleaned on script exit)
You probably didn't notice, but it will have to hit a few gigs of ram until it crashes like above.
from imageput.
Add documentation to delete the buffers
Also, add an update() method to Imageputbuffer (for screen capture only)?
from imageput.
The problems seems to be with ImageSearch
. Whenever the function is called the memory use increase a bit. I tested on this hotkey:
F1::
{
static img := ImagePutBuffer("Code")
static search := ImagePutBuffer("images/waypoint_1.png")
loop {
xy := img.ImageSearch(search)
Sleep(100)
}
}
The increase is very small... About 1MB each minute... I think that's why it took more than an hour to crash on my script.
from imageput.
Related Issues (20)
- Receiving "invalid UTF-8 payload" from server when sending ImagePutBase64 strings HOT 2
- when i use it to set menu tray icon, it looks sharper HOT 6
- [Question] Is it possible to get the bitmap of a hidden window? HOT 1
- How do I use flags (scale and crop) with other arguments in ImagePutWindow? (More/more detailed examples please.) HOT 5
- can gdip save as ".ico"? HOT 4
- Puzzled in pBitmap, hBitmap and BitmapBuffer HOT 1
- pStream cannot be zero HOT 2
- 能否实现判断两张图片的相似度? HOT 3
- No ImageSearchAll() in ImagePut.ahk(for v2) HOT 1
- screen flicker/flash when taking bitmap HOT 3
- Recursion error on AHK_H2 HOT 4
- Pixel Inflation HOT 1
- Improve ImageSearch HOT 9
- Improve ImageSearch 2 HOT 31
- webp support HOT 2
- Crop() issues HOT 1
- Notes: Test out WIC? HOT 2
- TransColor makes ImageSearch fail. HOT 1
- ImagePutWindow fails on webp HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imageput.