How To Create an App Like Instagram With a Web Service Backend - Part 2/2

Discussion of the official tutorials published on raywenderlich.com. Please only discuss the official tutorials here - for general questions, use the General Discussion forum instead.

How To Create an App Like Instagram With a Web Service Backend - Part 2/2

Postby rwenderlich » Thu Jul 12, 2012 11:00 am

This is the official thread to discuss the following blog post: How To Create an App Like Instagram With a Web Service Backend - Part 2/2
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2145
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 332 times

Re: How To Create an App Like Instagram With a Web Service B

Postby netsmith » Thu Jul 12, 2012 3:22 pm

Great tutorial as ever.

Along similar lines is the http://theopenphotoproject.org/

although its based around their backend system, they also offer an opensource ios app, which uses Avairy for the photo filter bits. Its quite complete and I learned quite a bit looking through their code.
https://github.com/openphoto/mobile-ios

Just thought it might help others

Cheers
Chris
netsmith
n00b
 
Posts: 3
Joined: Tue Oct 25, 2011 8:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How To Create an App Like Instagram With a Web Service B

Postby RedMak » Thu Jul 12, 2012 11:01 pm

thank you for this tuto, i'm working on similar app and i have a question:
in my app, a monument can have more then one image, so i store them in a folder with her id as name, it is a good approach ? i say that because you say that storing all files in one folder is not good, is my solution better ?
thank you again.
RedMak
Baby Hacker
 
Posts: 6
Joined: Thu May 03, 2012 11:07 am
Has thanked: 1 time
Been thanked: 0 time

Re: How To Create an App Like Instagram With a Web Service B

Postby StobyWan » Fri Jul 13, 2012 12:09 am

Thanks for the tutorial.

the images on my 4s are not filling the entire photoView cell? I thought I got it but I did not...

Thanks again...
StobyWan
n00b
 
Posts: 3
Joined: Mon Jul 02, 2012 12:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: How To Create an App Like Instagram With a Web Service B

Postby icanzilb » Fri Jul 13, 2012 7:39 am

@RedMak - well whether that's a good approach depends how much folders are you going to have . If you forsee having few hundred monuments and therefore few hundred folders that's still ok ... however if you have 5,000 folders then you are going to have a problem seeing the listing of the folder containg all the sub-folders.

Creating a real balanced tree will cost you ease of use, and any other approach would not create a balanced file load. It all depends on the proportions of your file storage ...

If you are about to launch a new app and you still don't know how much load it will take, maybe try some other way - like create a subfolder for each day photos are uploaded like 20120713, 20120714, etc - this gives you the benefit of always having them ordered when you do file listing + you'll have at most 365 folders for the first year, and then you can reevaluate what to do further

The best tip though is to store the path to the photos in your database - this way, if the system grows and you need a better method, or you need to adjust anything in the storage mechanism - you can just start using the new code which you put in place - because if the photos are just found by the path saved in the database, you won't care if you change the folder balancing mechanism or even the server where they are stored ...
User avatar
icanzilb
Team Member
iOS Tutorial Team Member
 
Posts: 370
Joined: Tue Jan 11, 2011 10:33 am
Has thanked: 12 times
Been thanked: 17 times

Re: How To Create an App Like Instagram With a Web Service B

Postby RedMak » Fri Jul 13, 2012 3:44 pm

yes i think ill store path in database it seems to bee the best(and easiest :) ) way to do this. thank you very much !
RedMak
Baby Hacker
 
Posts: 6
Joined: Thu May 03, 2012 11:07 am
Has thanked: 1 time
Been thanked: 0 time

Re: How To Create an App Like Instagram With a Web Service B

Postby Skov » Sun Jul 15, 2012 8:23 pm

now my app is running perfect, well not really ....

when i open the simulator all the thumbnail´s are the right size, but on the iPhone the img´s are smaller ....

http://www.simpelapps.dk/foto.PNG
Skov
Baby Hacker
 
Posts: 8
Joined: Fri Jul 13, 2012 12:42 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How To Create an App Like Instagram With a Web Service B

Postby PenguinGab » Mon Jul 16, 2012 9:47 am

Skov that is because iPhone 4 is retina, you have to make provisions for that in your code :) If I am not wrong it's smaller by half right?
User avatar
PenguinGab
Baby Hacker
 
Posts: 7
Joined: Sat Apr 07, 2012 7:43 pm
Has thanked: 0 time
Been thanked: 1 time

Re: How To Create an App Like Instagram With a Web Service B

Postby Skov » Mon Jul 16, 2012 7:58 pm

PenguinGab wrote:Skov that is because iPhone 4 is retina, you have to make provisions for that in your code :) If I am not wrong it's smaller by half right?


you can se how small it is on the link i posted ...

ill look in to that ty ...
Skov
Baby Hacker
 
Posts: 8
Joined: Fri Jul 13, 2012 12:42 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How To Create an App Like Instagram With a Web Service B

Postby JakeB » Wed Jul 18, 2012 11:54 pm

Nice tut!

I made 2 small changes and the images will work in iPhone 4 retina version
First in PhotoView.m I changed the success block from

Code: Select all
 UIImageView *thumbView = [[UIImageView alloc] initWithImage:image];
[self insertSubview:thumbView belowSubview:caption]; 

to
Code: Select all
 UIImageView *thumbView = [[UIImageView alloc] initWithImage:image];
thumbView.frame = CGRectMake(0, 0, 90, 90);
 [self insertSubview:thumbView belowSubview:caption]; 


I just changed the image size to 90.
This will make the small images fill the width but the thumbs are a bit pixelated. So I changed one more thing on the server side where the thumb image was being generated.

in api.php
I changed --
Code: Select all
thumb("upload/".$IdPhoto.".jpg", 90);

to
Code: Select all
thumb("upload/".$IdPhoto.".jpg", 180);


this will double the size of the thumb image so it looks a little better on retina devices.
JakeB
Hacker
 
Posts: 11
Joined: Wed Apr 25, 2012 7:44 pm
Has thanked: 1 time
Been thanked: 1 time

Next

Return to Official Tutorials

Who is online

Users browsing this forum: No registered users and 9 guests