GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

GPUImageCreateResizedSampleBuffer method is weird..

Open donobono opened this issue 14 years ago • 2 comments

To get a small image, I tried to use GPUImageCreateResizedSampleBuffer method.. Before GPUImageCreateResizedSampleBuffer method, memory was used just under 9MB, but after that method, memory usage goes to over 50MB.. I resized the image to 1600 * 2134 (pixels)..

This is a log data when I use GPUImageCreateResizedSampleBuffer method..

2012-08-03 16:30:50.070 FisheyeCam[5027:707] [1] --------------> - Memory used: 6787072 2012-08-03 16:30:59.104 FisheyeCam[5027:707] Before still image capture - Memory used: 8773632 2012-08-03 16:30:59.952 FisheyeCam[5027:707] After captureStillImageAsynchronouslyFromConnection - Memory used: 8871936 2012-08-03 16:30:59.954 FisheyeCam[5027:707] dWidth : 2134.000000, dHeight : 1600.000000 2012-08-03 16:31:00.294 FisheyeCam[5027:707] After GPUImageCreateResizedSampleBuffer - Memory used: 54497280 2012-08-03 16:31:00.632 FisheyeCam[5027:707] After captureOutput - Memory used: 54517760 2012-08-03 16:31:00.692 FisheyeCam[5027:707] After UIImage generation - Memory used: 54517760 2012-08-03 16:31:02.439 FisheyeCam[5027:707] After writing to library - Memory used: 8949760

Because of this issue, app quite often crash..

What can I do to solve this problem?

donobono avatar Aug 03 '12 07:08 donobono

That function is just a stopgap to make images fit within the texture size of the iPhone 4 and iPad 1, and isn't really intended as a general purpose resizing method. As you can see, it's not very efficient.

BradLarson avatar Aug 03 '12 14:08 BradLarson

I see... Thank you for your comment.. :-)

donobono avatar Aug 04 '12 06:08 donobono