Page 1 of 1
Memory error
Posted: Thu Oct 10, 2024 10:10 am
by Natter
I'm trying to glue 2 bitmap files and save them to a files:
map1.jpg -
https://cloud.mail.ru/public/yDjE/jFfNgNw7s
map2.jpg -
https://cloud.mail.ru/public/UpXQ/CxwNAb4Nc
Code: Select all | Expand
hBmp:=FW_StitchImages(path+"\map1.jpg", path+"\map2.jpg", "B")
FW_SaveImage(hBmp, path+"\map.jpg")
When writing to a file, I get a memory error:
hb_xgrab can't allocate memory
How to solve this problem ?
Re: Memory error
Posted: Thu Oct 10, 2024 10:51 am
by paquitohm
Please, try so,
Code: Select all | Expand
hb_GCAll(.t.)
hBmp:=FW_StitchImages(path+"\map1.jpg", path+"\map2.jpg", "B")
hb_GCAll(.t.)
FW_SaveImage(hBmp, path+"\map.jpg")
DeleteObject(hBmp)
hb_GCAll(.t.)
Re: Memory error
Posted: Thu Oct 10, 2024 11:26 am
by Natter
It breaks anyway
Re: Memory error
Posted: Thu Oct 10, 2024 12:00 pm
by karinha
https://fivetechsupport.com/forums/view ... 25&start=0
Do the same test with 2 smaller .jpg files, to make sure it's not the size of the images that blows up the memory.
Haga la misma prueba con 2 archivos .jpg más pequeños, para asegurarse de que no sea el tamaño de las imágenes lo que explote la memoria.
Regards, saludos.
Re: Memory error
Posted: Thu Oct 10, 2024 12:23 pm
by Natter
Why do I need a link to my topic ?
There I tried to glue 2 files with a size of about 12 mG and broke down from memory.
Now I have learned how to compress jpg files by about 9 times (up to 1.5 mG), but I get the same error
Re: Memory error
Posted: Thu Oct 10, 2024 12:38 pm
by Enrico Maria Giordano
Can I see a little but still compilable and runnable sample showing the problem (with the 2 images), please?
Re: Memory error
Posted: Sat Oct 12, 2024 4:59 pm
by nageswaragunupudi
I could see the images but could not download them.
It appeared to me that the size of each image is very huge and both together may not be fitting in the memory.
Then this should probably work with 64 bits application.
Mr. Natter
Can you please provide this information for each jpg?
Code: Select all | Expand
aImage := FW_ReadImage( nil, cJpeg )
? aImage[3], aImage[4] // width, height
PalBmpFree( aImage )
Also, size of the file on disk in bytes