Coder Social home page Coder Social logo

Multiple issues about fresco HOT 20 CLOSED

facebook avatar facebook commented on April 29, 2024
Multiple issues

from fresco.

Comments (20)

IlyaEremin avatar IlyaEremin commented on April 29, 2024 1

I have same issue with image loading. I use SimpleDraweeView.setImageURI(Uri.parse(uriStr)) with next link: http://az735069.vo.msecnd.net/posts/25_8cb72bffeee54d50bc075be2ad3cf56a_o.jpg and I see only placeholder (picasso loads this image fine)
But with this link: https://freeme.blob.core.windows.net/posts/25_2576773736e8485f9698eb126de3960e_o image is loaded fine. I think the issue may be related with ".jpg" ending.

from fresco.

plamenko avatar plamenko commented on April 29, 2024

Yes, there is a typo in the documentation, it should be just .setOldController(view.getController()), thanks.

For initialization, see our "Getting started with Fresco" page, it's on the very beginning:
http://frescolib.org/docs/index.html#_
Your code looks fine, you are just missing: Fresco.initialize(context); somewhere near the app startup.

No casting is necessary, you can just build DraweeController. See the example in our sample app:
https://github.com/facebook/fresco/blob/master/sample/src/main/java/com/facebook/fresco/sample/adapters/FrescoAdapter.java#L63

from fresco.

plamenko avatar plamenko commented on April 29, 2024

...continuing discussion from reddit comment.

"SimpleDraweeView was not initialized" is thrown if SimpleDraweeView is instantiated without previously initializing it (static method). Fresco.initialize does exactly that:
https://github.com/facebook/fresco/blob/master/drawee-backends/drawee-pipeline/src/main/java/com/facebook/drawee/backends/pipeline/Fresco.java#L44

So, I suspect that you are not calling Fresco.initialize early enough. Where are you doing that call?

from fresco.

broakenmedia avatar broakenmedia commented on April 29, 2024

It's the first thing in the onCreate in an Activity!

On 27 Mar 2015, at 6:05 am, Ognjen Dragoljevic [email protected] wrote:

...continuing discussion from reddit comment.

"SimpleDraweeView was not initialized" is thrown if SimpleDraweeView is instantiated without previously initializing it (static method). Fresco.initialize does exactly that:
https://github.com/facebook/fresco/blob/master/drawee-backends/drawee-pipeline/src/main/java/com/facebook/drawee/backends/pipeline/Fresco.java#L44

So, I suspect that you are not calling Fresco.initialize early enough. Where are you doing that call?


Reply to this email directly or view it on GitHub.

from fresco.

fiskurgit avatar fiskurgit commented on April 29, 2024

Think it needs to be done in your Application onCreate() instead

from fresco.

broakenmedia avatar broakenmedia commented on April 29, 2024

@fiskurgit Really? The doc does not mention that? I can't actually use an Application class, for various reasons.

from fresco.

fiskurgit avatar fiskurgit commented on April 29, 2024

oops, no, sorry, just looking through example code now, they're even initialising in Adapters in the sample

from fresco.

broakenmedia avatar broakenmedia commented on April 29, 2024

Quick update, managed to get it running with SimpleDraweeView by initializing in the activity that opens BEFORE the one in question, unfortunately it STILL does not load the image, just shows the place holder for ever. Working fine with Picasso and the same URI however

from fresco.

broakenmedia avatar broakenmedia commented on April 29, 2024

Even further still, using a plain SimpleDrawee, removing all code but the basic i.setImageURI(uri) will not load the, nor does it show the placeholder at anypoint (set in XML), no conflicting hierarchy set

from fresco.

broakenmedia avatar broakenmedia commented on April 29, 2024

It looks as though the issue is a typo in the documentation. It should be http://schemas.android.com/apk/res-auto rather than http:/schemas.android.com/apk/res-auto (note the extra '/') <- Fixed the missing placeholder, no loading still however. Just out of interest, what method do you recommend for building a Uri based on a url? Perhaps that's the issue? Is there any debug output in Fresco?

from fresco.

IanChilds avatar IanChilds commented on April 29, 2024

Uri.parse(url) should do the trick.

from fresco.

nbradbury avatar nbradbury commented on April 29, 2024

@xbroak Perhaps the problem is as simple as not having <uses-permission android:name="android.permission.INTERNET" /> in your manifest?

from fresco.

plamenko avatar plamenko commented on April 29, 2024

How do you build the Uri?

from fresco.

plamenko avatar plamenko commented on April 29, 2024

There is a bug in our default network fetcher that I'm hunting now. We also provide OkHttp fetcher that doesn't suffer this issue. See: http://frescolib.org/docs/using-other-network-layers.html#_

from fresco.

plamenko avatar plamenko commented on April 29, 2024

Closing this issue because it's not focused. Please create separate issues to track one thing at a time.

from fresco.

broakenmedia avatar broakenmedia commented on April 29, 2024

Just FYI, the issues are unfixed, i'm just going to give the lib a pass. Too many issues for me right now, perhaps i'll come take another look in the future when everythings up-to-date etc... Thanks for the help however!

from fresco.

plamenko avatar plamenko commented on April 29, 2024

For the record, I found the issue:

<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://freeme.blob.core.windows.net/posts/25_8cb72bffeee54d50bc075be2ad3cf56a_o.jpg">here</a>.</h2>
</body></html>

HttpURLConnection does not follow redirection.

from fresco.

plamenko avatar plamenko commented on April 29, 2024

@xbroak , it would help if you could create a separate issue for each problem you have rather than just dumping all of them in one issue.
The URI redirection issue can be solved by using some smarter networking library, rather than the default one which is pretty cumbersome. We do provide OkHttp integration and it should be pretty straightforward to set it up. There is a section in our documentation.
As for the other issues, I don't know what else is there left? There were a couple of typos in the docs, but I believe this has been resolved?

from fresco.

broakenmedia avatar broakenmedia commented on April 29, 2024

I didn't have a URI Redirection problem? That was another user! Regardless, good luck with the project! :)

from fresco.

broakenmedia avatar broakenmedia commented on April 29, 2024

Well, i went ahead and added the OKHttp just to see if it made any difference, only to hit another issue:

java.lang.NoSuchMethodError: com.squareup.okhttp.OkHttpClient.open
at com.squareup.okhttp.OkUrlFactory.open(OkUrlFactory.java:44)

using: compile 'com.facebook.fresco:imagepipeline-okhttp:0.1.0+'

from fresco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.