I am working on a chat application. In that, I have implemented picture uploading and downloading using NMSSH library. Now I am saving the downloaded and uploaded image in app documents file also (saving in iphone gallery too), so that I can display the image after tableview reloading. Is saving images in documents folder is a good method? Is documents folder have any size limit? Is there any way to get the path for the image in gallery?
Related
I have linked images to my App using links located in google Drive, the images are displayed without problems in the APP but when I want the data to be reflected in a PDF report the links are shown as broken.
How can I place, embed or place these images in a PDF document?
I followed the following explanation and it worked fine for the App but not for the PDF.
In App
In PDF
I am an intern iOS developer currently working on a camera app. The app saves video from camera and gif of the video in the temporary directory folder. My question is how can i move both files in a single file with a custom file header which contains the length of bytes from the video and gif and then load and present the video and gif from the same file? I would be grateful if someone could provide me with an explanation or tutorial or some library. Thank you
I have around 1000 ’s of Images, I want show them in my app. What are the possibilities to do that..
The ideas which I’m thinking
1.Saving all images in phone gallery. accessing images form gallery… but It seems not possible as each iOS app has its own sandbox.
2.Saving in my bundle which will increase the memory size.
In android there is a control called “ViewPager”, how can i achieve the same control in iOS ….
Tried scrollview with paging technique but crashes due to memory ....
Please guide me…..
I dont think you can show images from the gallery directly to your application . But you can store it into document directly , for that you have to first pick images from the gallery . you can refer
How to load photos from photo gallery and store it into application project?
And next time when you start application you can load images from the document directory so you dont need to go to the gallery again .
I'm creating an iOS app where I need to use many photos(in big resolution). There're almost 400 photos. I want to use them to show in UIImageView on the different pages.
But it's a big bunch of data. So I'm afraid about efficient(not so much) and size of the app itself. What's the best way to use these photos in my iOS app? Does it make sense to create New Image Set and create 1x,2x and 3x photos for each photo or do I have to use other features I don't now about?
UPD1:
The app is about sights. From the tableview user can chose any sight and will be shown screen with 1-3 photos( in CollectionView if there's more than 1 photo) and some text. All data(except photos) I'm getting from sqlite db using CoreData.
The photos are shown on the screen have width equal to screen width (the height 25:38 from width). Width is bigger:)
I want to use big resolution photos because I want show full-size
photos by tap.
Each photo can be 2000px or more on the biggest
side.
The app is an offline app so I want to store photos in the
app. I now just about image assets. But are there other ways to
store photos?
I have an idea to store them in high-resolution and resize to any device(3x, 2x, 1x) to display on the screen. And load high-resolution version of a photo just when user taps on it to show the photo on the full screen.
You cannot load all the photos from the app - this is btw. not possible because of memory issues during loading images.
You should at the beginning think about presenting photos and photos itself.
Do you really need to show photos in big resolution?
What big resolution means? Is that 1024x1024 or native resolution or what?
From where these photos are loaded? App includes it or you'll load them from system library? I see you're writing about image assets, probably you want to keep them in the app.
Do you need to show this images in constant almost 0 time? Maybe keeping it on the backend and fetching and cache when necessary will be better approach. With this you can decrease size of the app.
You can keep in assets only the biggest one - the #3x and resize it on devices that need this in runtime before displaying it.
To keep photos in device's memory you can use NSCache - Apple's Documentation and let system managing the photos. You'll load this and cache in the instance of NSCache and every time you want to access it and get photo you have to check if there is photo or nil and if nil you have to re-load it again from the disk. This will somehow keep your device to not get memory warnings and will automatically managing photos.
Another important thing to think is to how you plan to show the photos. Is is possible to show only 1 at a time or there is more to show? Do you want to present thumbnails of them and after user select some photo show it in the big resolution? Using thumbnails will have less memory footprint.
Update 1:
UPD1: The app is about sights. From the tableview user can chose any places and will be shown screen with 1-3 photos( in CollectionView if there's more than 1 photo) and some text. All data(except photos) I'm getting from sqlite db using CoreData.
The app is an offline app so I want to store photos in the app. I now just about image assets. But are there other ways to store photos?
You don't need assets catalog for this. Just keep it in some directory in the project and load them from /Documents directory when necessary. IMO this will be the best possible approach to store and use locally. Keeping them in the assets will cause that there will be #1x and #2x empty in xcassets file. And keeping them directly in project will be easier to maintain I think.
I want to use big resolution photos because I want show full-size photos by tap.
Each photo can be 2000px or more on the biggest side.
I have an idea to store them in high-resolution and resize to any device(3x, 2x, 1x) to display on the screen. And load high-resolution when user taps on the photo to show photo on the full screen.
Keeping such big photos in the app is poor idea, the app will be big. Even if one photo will be 1mb size which I think is not possible and there are 400 photos the app will be fat.
You should consider keeping them online, really.
You also know all the images in the app so you can create thumbnails in real time and cache them in /Cache directory for later use. The same with big photos for specified device screen resolution. Before displaying resize it and save in /Cache directory for future next time use.
I'm getting a list of ALAsset items (images and videos) from a specific photo album and trying to view them using a QLPreviewController.
Unfortunately because ALAsset doesn't provide a real file url, just the "assets-library://" type url, viewing them in a QLPreviewController using just that url isn't possible.
My only solution was to first copy each of those ALAssets into the Documents folder inside my app (getting the raw data from an ALAssetRepresentation and saving it in a file), and viewing those with the QLPreviewController, but it ends up being too slow and sluggish when the number or size of files gets bigger.
Is there any way to get this done? Is there any other way to enumerate through the items inside a photo album that would return a true filesystem URL? Or should I just try to make my own preview controller with UIImageViews and MPMovieControllers and recreate all the functionality (swipe, share, etc)?