Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 48

NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
09/29/13 07:55 AM (12 years ago)

Thumb Viewer screen (iOS) image storage question

Maybe obvious to better coders ;) ... my questions are specific to Danny's awesome plugin ThumbViewer. Was wondering the implications of using the plugin in an app that could grow to present hundreds of images to the user, and was worried about app data storage. Figured I would divide up my images into lots of ThumbViewer screens each with a max of 20 pics (so all the thumbnails appear on one iPhone screen). Questions: (images stored at URL) 1) When are the thumbnails first generated? When screen first loaded or when 'Show Me the Images' selected? 2) Are the thumbnails once created always part of the app data? [Assume] the full images are not stored but loaded each time a user clicks on a thumbnail. 3) Say there were 10 images originally in the screen, and I add a couple of images stored at my url- the next time the user enters that screen what thumbnails are generated? All or just the thumbnails for the new images? Performance: I think I saw this discussed in another thread... Is there a way to use a set image (either stored in Control Panel or specific image at url (would use a smaller image) which can be used as the first image in the album. Since the default behavior of the plugin is to select a random image, I noticed this can be slow sometimes depending on image size and connectivity).(Would be a nice change) Thanks, Kevin
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
09/29/13 09:51 AM (12 years ago)
Hi NCBuzz, If you create several screens there is no problem with performance or whatever. You can create thousands of screen with each 20 or 50 images in it. Questions: 1 + 2: the only thing that gets loaded is the original image - the thumb is created on the fly. The images are loaded AFTER you hit 'show me the images'. 3. If you use the dataURL to present the images, and you add images to the remote location, nothing will happen to a user who is already 'in' your app. In order to see them he has to refresh the app. You could 'alarm the users' that there is new content (images in this case) to go into your control panel and hit the save in the dataURL (or whatever 'save' button you want to click). if you use the control panel to add new images, hitting the 'save-button' will result in the same. For a controled image and not a random one look for this code in BTA_thumbviewer.m (line 824): NSUInteger randomIndex = arc4random() % [networkImagesMutable count]; NSUInteger randomIndex2 = arc4random() % [networkImagesMutable count]; tvNetworkFirstAlbumImage = [networkImagesMutable objectAtIndex:randomIndex]; tvNetworkSecondAlbumImage = [networkImagesMutable objectAtIndex:randomIndex2]; Make it look like this (delete first 2 line NSUInteger): tvNetworkFirstAlbumImage = [networkImagesMutable objectAtIndex:0]; tvNetworkSecondAlbumImage = [networkImagesMutable objectAtIndex:1]; Where 0 = the first image and 1 is the second image in the album. Choose (any number) whatever image you like to show. Hope this helps. Best Regards, Danny
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
09/29/13 09:54 AM (12 years ago)
Don't know if you already had a look at my post but I made some edits. Best Regards, Danny
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
09/29/13 10:36 AM (12 years ago)
Just saw it... Being able to set a default image for the album (and 2nd) is great. When you said: The images are loaded AFTER you hit 'show me the images'. Does this mean that they remain in the app for future viewing, or will be reloaded the next time the user uses the 'show me the images' for the same album? I'll need to think about the best way to alert the user to refresh for new images in different albums (save button or push notifications, because they might not be interested in that album that got the new images), but this will keep me busy for awhile ;) Thanks again Danny, Kevin
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
09/29/13 11:13 AM (12 years ago)
Hi kevin, The images are not saved within the app so if you open the album again they get loaded again each time! Best Regards, Danny
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
09/29/13 11:26 AM (12 years ago)
Just what I was hoping. Thanks.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.