mwaterfall / MWPhotoBrowser

A simple iOS photo and video browser with grid view, captions and selections.
MIT License
8.75k stars 2.72k forks source link

Large images cause crash on Device #53

Closed ArloL closed 12 years ago

ArloL commented 12 years ago

When I load "lots" of large (>=2MP) images the viewer occasionally crashes due to low memory.

To test it I added these pictures to the flickr part of the demo.

            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://1.bp.blogspot.com/--LtN-73xjcw/T3EAnNauZsI/AAAAAAAAAIk/fczGILxBxHw/s1600/ireland2.jpg"]]];
            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://2.bp.blogspot.com/-zrVPELY19zY/T3EAo0lp35I/AAAAAAAAAIs/lJrCTsehBJw/s1600/ireland_philmack.jpg"]]];
            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://2.bp.blogspot.com/-kvJ60qvw-_Q/T3EA0ARbtiI/AAAAAAAAAI0/58bcB8Drz-Q/s1600/Dunguaire-Castle-Kinvara-County-Clare-Ireland.jpg"]]];
            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://www.wallpapers-free.co.uk/backgrounds/nature/beaches_and_coasts/Copy-1-of-Sunset-Across-Lower-Lough-Erne-Fermanagh-Ireland.jpg"]]];
            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://1.bp.blogspot.com/_SZpkjg0HXck/SxLlR-hl3iI/AAAAAAAAADA/5_wxb_AxyVk/s1600/Ireland+2009+229.JPG"]]];
            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"https://upload.wikimedia.org/wikipedia/commons/e/e6/Bingley_Ireland_Bridge_1.jpg"]]];
            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://fc03.deviantart.net/fs30/f/2008/059/7/5/Typical_Ireland_Landscape_by_peterwadson.jpg"]]];
            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://bestfreewallpapers.info/Ireland%20Wallpapers%20%5B1920x1440%5D%20HD%20Collection/Clifden%20Castle,%20County%20Galway,%20Ireland.jpg"]]];
            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://www.wallpapers-free.co.uk/backgrounds/animals/horses/Wicklow-Countryside-Near-Powerscourt-Castle-Ireland.jpg"]]];
            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://onlyhdwallpapers.com/wallpaper/lough_key_forest_park_ireland_1600x1200_id_desktop_wallpaper-309617.jpg"]]];
            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"https://aishagrace.files.wordpress.com/2009/07/04ballintoy-northern-ireland.jpg"]]];
            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"https://woonsocketlibrary.files.wordpress.com/2011/03/celebrating_ireland.jpg"]]];
            [photos addObject:[MWPhoto photoWithURL:[NSURL URLWithString:@"http://www.atpm.com/15.08/travels/images/Ireland%20-%20Ruins%20Off%20the%20Coast%20of%20Dalkey.jpg"]]];

I am testing using an iPhone 3GS. I had a look in Instruments and the app's memory consumption is steadily increasing with every image. In comparison the Photos app is steady in it's memory consumption.

jeremangnr commented 12 years ago

have a look at this https://github.com/mwaterfall/MWPhotoBrowser/issues/30

ArloL commented 12 years ago

Sorry about that. I looked at the issues but I just missed that one.

Thanks a lot.

As far as I can tell now the Photos app is not using the full resolution image but a down-sized version. If I use images of similar size everything is fine.