Memory error

Post Reply
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Memory error

Post 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 ?
paquitohm
Posts: 284
Joined: Fri Jan 14, 2022 8:37 am

Re: Memory error

Post 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.)
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Memory error

Post by Natter »

It breaks anyway :cry:
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: Memory error

Post 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Natter
Posts: 1226
Joined: Mon May 14, 2007 9:49 am

Re: Memory error

Post 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
User avatar
Enrico Maria Giordano
Posts: 8728
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Memory error

Post by Enrico Maria Giordano »

Can I see a little but still compilable and runnable sample showing the problem (with the 2 images), please?
User avatar
nageswaragunupudi
Posts: 10691
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Memory error

Post 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
Regards

G. N. Rao.
Hyderabad, India
Post Reply