Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to add image upload capabilities #81

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

hamiltont
Copy link

Hey there,
Ive been working on a side project trying to make it so that reddit-is-fun can upload images, so that I can rapidly send an image to reddit while i'm out walking around w/my phone. I started by making it upload to Imgur, but I tried to make it OO enough that someone could change that relatively easily.

Probably the biggest issue I can think of is that I have not integrated this into the main GUI code at all. That seemed to be changing pretty quickly, and I was not too sure where it was going. I created a tester activity that shows off what my upload code can do so far, but I know even the gui in my tester could be improved, it's not really my strong suite.

… images to work first, so this is all relative to that
Next steps is to make this a background
operation, and then to interface with the
submit activity. Then update the submit
activity to detect an image and display
a thumbnail.
Split preview rendering and uploading into two separate
AsyncTasks.

It would be nice to eventually add in a strategy pattern
to allow other sites besides imgur to be used. Next steps
include adding progress indications to an image upload,
and merging this with the submit activity. Also, I am
a bit behind on commenting.
progress updates from the ASyncTasks. Need to implement
a progress bar for the upload progress. Added a
ProgressBar spinning image on top of the image preview
Imgur is currently working. The API seems questionable, it seems to
occasionally fail for no reason I have been able to detect. Committing
so I have a recent version where uploading works
…ultiPartEntity

only posts an update approx once every percent. Posting an update with every write
to the OutputStream results in a huge waste of time and a lot of extranneous method
calls.
@talklittle
Copy link
Owner

Awesome! I will take a look at this when I get some time, hopefully within a week or so. I think you said it also handles downloading of images bypassing browser? Cool

@hamiltont
Copy link
Author

Hey - sorry I misread the other issue. This code only does uploading of images (although some of it could be used for downloading purposes if you modified it)

@hamiltont
Copy link
Author

Hey talklittle,

Was there something that needed addressing in this code, or have you just been busy?

Thanks,
Hamy

@talklittle
Copy link
Owner

Hey Hamy, I'm sorry for being negligent about pulling the patches. You are correct, I'm busy with my last semester of school. I haven't yet tried your patch, but I plan to do that and a lot of needed legwork on the app once I have a stretch of free time.

Thanks a lot,
Andrew

@hamiltont
Copy link
Author

Not a problem, I understand being busy at school ;)

I was just touching base and making sure you hadn't found problems

@hamiltont
Copy link
Author

Hey Andrew,

Just bumping this again! If you have a bit of time over winter break it would be awesome to get some feedback :D

Thanks,
Hamilton

@talklittle
Copy link
Owner

Definitely. Sorry for the huge delay...

@hamiltont
Copy link
Author

Not a problem at all! I can understand life during school is crazy busy ;)

@hamiltont
Copy link
Author

Hey Andrew,

Do you have some time to let me know what you think about this?

@talklittle
Copy link
Owner

Hi crabpot, It looks like you have done some good work on the backend
part, i.e. handling the upload logic. Since I am not at my regular
computer (can't access github password stored in KeePass) I'll write
some high level comments in this email, and maybe later write more
detailed commit notes on github.

Bojan might be carrying the reddit is fun torch in the future, so I'll
let him know to contact you.

  • The file uploading part looks useful and could probably be extended
    to other kinds of uploads.
  • I appreciate the thoroughness in handling the different error
    conditions, and also providing a way to pause image uploads.
  • The apache mime4j jar is unfortunate -- 346 kb. is there a way to
    extract just the parts we need, and include the needed classes
    directly in the package?
  • I can't merge this in without a UI. Like I said, the underlying
    logic is great but we need a UI, as well as a nice way to integrate
    with existing UI. maybe you can collaborate with Bojan on that, if you
    and he want to do that together -- he is actually revamping the whole
    UI, so I highly recommend talking to him if you want to see this
    feature integrated.

Thanks a lot!

On Fri, May 13, 2011 at 11:52 PM, crabpot8
reply@reply.github.com
wrote:

Hey Andrew,

Do you have some time to let me know what you think about this?

Reply to this email directly or view it on GitHub:
#81 (comment)

@hamiltont
Copy link
Author

Cool, thanks for the reply! Definitely put bojan in touch with me - I can
likely remove
most / all of the apache library. The lack of a UI was actually fairly
purposeful, I didn't
know anything about the reddit-is-fun UI, so I was hoping I could get
someone knowledgeable
willing to plug into the API I exposed. If I remember correctly I've got a
small sample of how
to integrate UI into the API included in the push, but you're correct that
it needs to be
integrated into the main reddit-is-fun codebase.

Thanks,
Hamilton

On Sat, May 14, 2011 at 6:46 AM, talklittle <
reply@reply.github.com>wrote:

Hi crabpot, It looks like you have done some good work on the backend
part, i.e. handling the upload logic. Since I am not at my regular
computer (can't access github password stored in KeePass) I'll write
some high level comments in this email, and maybe later write more
detailed commit notes on github.

Bojan might be carrying the reddit is fun torch in the future, so I'll
let him know to contact you.

  • The file uploading part looks useful and could probably be extended
    to other kinds of uploads.
  • I appreciate the thoroughness in handling the different error
    conditions, and also providing a way to pause image uploads.
  • The apache mime4j jar is unfortunate -- 346 kb. is there a way to
    extract just the parts we need, and include the needed classes
    directly in the package?
  • I can't merge this in without a UI. Like I said, the underlying
    logic is great but we need a UI, as well as a nice way to integrate
    with existing UI. maybe you can collaborate with Bojan on that, if you
    and he want to do that together -- he is actually revamping the whole
    UI, so I highly recommend talking to him if you want to see this
    feature integrated.

Thanks a lot!

On Fri, May 13, 2011 at 11:52 PM, crabpot8
reply@reply.github.com
wrote:

Hey Andrew,

Do you have some time to let me know what you think about this?

Reply to this email directly or view it on GitHub:
#81 (comment)

Reply to this email directly or view it on GitHub:
#81 (comment)

@hamiltont
Copy link
Author

Are we talking about https://github.com/bojan ? If so I'll contact him about the UI.

@talklittle
Copy link
Owner

It's actually https://github.com/bsimic0001

Good luck! Thanks for the contribution & enthusiasm :)

@blueyed
Copy link

blueyed commented Jul 4, 2011

What is wrong with using another (specialized) app (like e.g. URLy, the regular Gallery etc) and then invoking the "Send to" action from there to pass the image on to "reddit is fun"?
Without looking at the patch itself I do not think that this app should have an upload feature.

@hamiltont
Copy link
Author

I...um...what? I'm so confused, this patch adds the ability for you to execute a 'Send to Reddit is fun' action. What are you talking about?

@blueyed
Copy link

blueyed commented Jul 5, 2011

Oh, I'm sorry then.. - did not want to cause any confusion, just add my opinion (without knowing enough apparently)!
I suppose the currently available "Send to Reddit is fun" action only applies to text/URLs then?
Currently I would upload an image using URLy and then send the resulting URL to "Send to Reddit is fun", which would then post it.

@hamiltont
Copy link
Author

Ah - I see what you were getting at now! Yup, it only (currently) applies to text and URLs, but this patch would make 'Reddit is fun" show up when someone chooses the "Share" option with an image as the attached data.

It's definitely debatable if this is a desirable feature - the patch itself has been sitting in a queue for a looong time now, so who knows if it will ever make it in. The negatives are that it contains a hefty library which would increase the APK size by a few hundred kilobytes, and it's (currently) tied to imgur.com. Both of these could change, I could remove that library and just make the patch contain a few source files and add in support for other image upload APIs, but there was so little interest generated by the initial patch I haven't put the time into doing that.

Functionally, I would use this a lot - It's actually in the compiled version I use on my phone, so that I can upload images without needing to do anything but add a caption. Granted this could be accomplished with a specialized uploader and then sharing the image URL with reddit is fun, that just seems (to me) like something that most users would not be aware of.

@shawn-simon
Copy link
Contributor

I think it's a cool feature...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants