You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by leokan23 <le...@best-web.gr> on 2020/06/26 16:58:47 UTC

Spark Image not loading a Firebase URL

Im trying to use a spark Image component to load an image from Firebase
Storage, but it looks like something is failing to load.

This url loads without issues (located in the root of my storage):
https://firebasestorage.googleapis.com/v0/b/mybucket.appspot.com/o/leo.jpg?alt=media

https://firebasestorage.googleapis.com/v0/b/mybucket.appspot.com/o/images%2Fleo.jpg?alt=media

<s:Image /> returns 404 in the second url, although it works in a browser.
This makes me think that the issue is the %2F used instead of / .

Could this be an encoding issue in the component? I am not sure if it uses
URLLoader to grab the image.



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: Spark Image not loading a Firebase URL

Posted by leokan23 <le...@best-web.gr>.
No idea why. Works in all my browsers.

Any how, using a urlrequest instead of string for source works, so I guess I
can live with this workaround. 



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: Spark Image not loading a Firebase URL

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi.  For me, URL2 does not work on my Macbook Pro in Safari or Chrome.

HTH,
-Alex

On 7/1/20, 7:39 AM, "leokan23" <le...@best-web.gr> wrote:

    Thank you for your reply. If you try the second set of links (real bucket)
    you can see both images in any browser.
    
    If you try to load them with a custom loader like bellow it works:
    
    <https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-flex-users.2333346.n4.nabble.com%2Ffile%2Ft659%2Fcarbon_%25283%2529.png&amp;data=02%7C01%7Caharui%40adobe.com%7Cf9d534661121472dd93208d81dcc99cf%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637292111945234891&amp;sdata=1vrI11BtaluDUn4xJ1ChBznv0XQuupoUI8aR3vwGzR8%3D&amp;reserved=0> 
    
    Using firebaseImg.source=url; where firebaseImg is Image spark or
    BitmapImage, doesn't work. 
    
    URL1 (works in all cases):
    https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Ffirebase-dogmate.appspot.com%2Fo%2Fze.png%3Falt%3Dmedia&amp;data=02%7C01%7Caharui%40adobe.com%7Cf9d534661121472dd93208d81dcc99cf%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637292111945234891&amp;sdata=rnRwye2AHXEQN9aSpvHYWffy01lq2dyjr1SuThwFK4k%3D&amp;reserved=0
    
    URL2 (works in browsers and loader but doesnt work for image.source=url)
    https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Ffirebase-dogmate.appspot.com%2Fo%2Fpublic_files%252Fze.png%3Falt%3Dmedia&amp;data=02%7C01%7Caharui%40adobe.com%7Cf9d534661121472dd93208d81dcc99cf%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637292111945234891&amp;sdata=oZQf0Ou%2FwAWo5e%2FEWAQRawjkSc2RslB5vTCdahXyIt0%3D&amp;reserved=0
    
    
    Final step to solve this (after checking the BitmapImage.as code) was to
    submit a UrlRequest instead of string.
    
    firebaseImage.source = new UrlRequest(url); seem to work in all cases. 
    
    
    
    --
    Sent from: https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-flex-users.2333346.n4.nabble.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7Cf9d534661121472dd93208d81dcc99cf%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637292111945234891&amp;sdata=FPNChGVzwx7I%2BbtUKr30ObM3zsq9ZiedatPkgmRR0Kg%3D&amp;reserved=0
    


Re: Spark Image not loading a Firebase URL

Posted by leokan23 <le...@best-web.gr>.
Thank you for your reply. If you try the second set of links (real bucket)
you can see both images in any browser.

If you try to load them with a custom loader like bellow it works:

<http://apache-flex-users.2333346.n4.nabble.com/file/t659/carbon_%283%29.png> 

Using firebaseImg.source=url; where firebaseImg is Image spark or
BitmapImage, doesn't work. 

URL1 (works in all cases):
https://firebasestorage.googleapis.com/v0/b/firebase-dogmate.appspot.com/o/ze.png?alt=media

URL2 (works in browsers and loader but doesnt work for image.source=url)
https://firebasestorage.googleapis.com/v0/b/firebase-dogmate.appspot.com/o/public_files%2Fze.png?alt=media


Final step to solve this (after checking the BitmapImage.as code) was to
submit a UrlRequest instead of string.

firebaseImage.source = new UrlRequest(url); seem to work in all cases. 



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: Spark Image not loading a Firebase URL

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Just about all Spark controls use a Skin.  ImageSkin.mxml (frameworks/projects/spark/src/spark/skins/spark/ImageSkin.mxml uses a BitmapImage.

But I think I mentioned that I got a 404 from my Safari browser.

-Alex

On 6/30/20, 3:06 AM, "leokan23" <le...@best-web.gr> wrote:

    Is there a way to replace the spark Image loader with a custom one? I tried
    checking the Image.as but I can't really figure out where the loading
    actually happens. 
    
    
    
    --
    Sent from: https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-flex-users.2333346.n4.nabble.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7C83019dd82f9b452a71c708d81cdd4123%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637291083894587682&amp;sdata=%2Bo5MCM1LESNHKwA8pWwEnzyXTC%2BQzi%2FfolCpAfZTiSE%3D&amp;reserved=0
    


Re: Spark Image not loading a Firebase URL

Posted by leokan23 <le...@best-web.gr>.
Is there a way to replace the spark Image loader with a custom one? I tried
checking the Image.as but I can't really figure out where the loading
actually happens. 



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: Spark Image not loading a Firebase URL

Posted by leokan23 <le...@best-web.gr>.
Both are examples, let me post real links.

1st - Works perfectly in
<https://firebasestorage.googleapis.com/v0/b/firebase-dogmate.appspot.com/o/Onirama.png?alt=media>
<s:Image /> 


2nd - Doesnt work in
<https://firebasestorage.googleapis.com/v0/b/firebase-dogmate.appspot.com/o/images%2FFWOb2MakZxXniDgLRjBgvPyVIaW2%2Fze.png?alt=media>
<s:Image/> but works if I do a custom Loader (flash.display.Loader) 

Also tried in Feathers SDK that uses MXML and Loader, and also works.





--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/

Re: Spark Image not loading a Firebase URL

Posted by Alex Harui <ah...@adobe.com.INVALID>.
I clicked on the 2nd link in Safari and also got a 404.

On 6/26/20, 9:59 AM, "leokan23" <le...@best-web.gr> wrote:

    Im trying to use a spark Image component to load an image from Firebase
    Storage, but it looks like something is failing to load.

    This url loads without issues (located in the root of my storage):
    https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Fmybucket.appspot.com%2Fo%2Fleo.jpg%3Falt%3Dmedia&amp;data=02%7C01%7Caharui%40adobe.com%7C0675b1a62c2148e46ba708d819f239c4%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637287875424998122&amp;sdata=Or720cLydKRZnKMOepAmBElZskOO%2B%2B%2BkPsE9OKiMl%2F0%3D&amp;reserved=0

    https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Fmybucket.appspot.com%2Fo%2Fimages%252Fleo.jpg%3Falt%3Dmedia&amp;data=02%7C01%7Caharui%40adobe.com%7C0675b1a62c2148e46ba708d819f239c4%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637287875424998122&amp;sdata=JJx8qzXjsZvyCIQzAlQqYm%2B3DAIgTywAbT1I5K3hWpM%3D&amp;reserved=0

    <s:Image /> returns 404 in the second url, although it works in a browser.
    This makes me think that the issue is the %2F used instead of / .

    Could this be an encoding issue in the component? I am not sure if it uses
    URLLoader to grab the image.



    --
    Sent from: https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-flex-users.2333346.n4.nabble.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7C0675b1a62c2148e46ba708d819f239c4%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637287875424998122&amp;sdata=g7zQ3fwEAubsBWgvBekaiClxVfcvkbxxalCoTEnNgwI%3D&amp;reserved=0