Memory error

Memory error

Postby Natter » Thu Oct 10, 2024 10:10 am

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 view  RUN
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 ?
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Memory error

Postby paquitohm » Thu Oct 10, 2024 10:51 am

Please, try so,

Code: Select all  Expand view  RUN
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.)
paquitohm
 
Posts: 266
Joined: Fri Jan 14, 2022 8:37 am

Re: Memory error

Postby Natter » Thu Oct 10, 2024 11:26 am

It breaks anyway :cry:
Natter
 
Posts: 1224
Joined: Mon May 14, 2007 9:49 am

Re: Memory error

Postby karinha » Thu Oct 10, 2024 12:00 pm

https://fivetechsupport.com/forums/viewtopic.php?f=3&t=44225&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
User avatar
karinha
 
Posts: 7832
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Memory error

Postby Natter » Thu Oct 10, 2024 12:23 pm

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

Re: Memory error

Postby Enrico Maria Giordano » Thu Oct 10, 2024 12:38 pm

Can I see a little but still compilable and runnable sample showing the problem (with the 2 images), please?
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Memory error

Postby nageswaragunupudi » Sat Oct 12, 2024 4:59 pm

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 view  RUN
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
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 45 guests