-
Notifications
You must be signed in to change notification settings - Fork 122
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
Problem with remote files #52
Conversation
Why build this functionality into Phashion directly when you can do this? require 'open-uri'
open("http://...") do |f|
i = Phashion::Image.new(f)
...
end |
Because, i found that would better organized in other class. |
@viniciusalonso I'm thinking about @mperham's question - why add this to pHashion? IMHO adding HTTP functionality to pHashion enlarges scope and adds complexity to the pHashion API. I think fetching remote images would fit really well as a separate gem that uses pHashion as a dependency. I think a seprate gem would more provide the flexibility and freedom to address issues like:
|
Ok @westonplatter ... What you think about use the solution proposal by @mperham , for solution this problem of simple form ? I believe would be more feasible at the moment |
👍 I understand the point that it can add complexity to Phashion, however one of the main targets of the gem is to detect duplicate and near-duplicate multimedia files. Thus, it does not matter if the image is in localhost or remote. Great job @viniciusalonso, and all the folks who created this gem. It is pretty useful. Thanks! |
Now i refactor code, and it is more simple and not increases the scope of gem |
@fellipebrito - Thanks for the additional feedback. @viniciusalonso - Thanks for the code changes. What I'm thinking is I'll code up a quick Proof of Concept showing how I'd think we could wrap the remote file functionality in another gem. I'd love to get your input on the idea. I'm still doing Thanksgiving weekend with the family so I should be able to get to it next week. |
@westonplatter Enjoy the thanksgiving time with your family man. Thanks for the GEM ;) Let me know if you wanna pair a little bit and talk about the other gem idea, I'd be glad to help you to create something else for the community. Cheers! |
Now is possible use a remote file, with the temporary file and your usage is normal equal of the Phashion::Image.