coronacards can't load remote jpg on Android

hi,

i’m testing coronacards (android trial version) and before getting a licence, i just want to try some simples tasks, like the loadRemoteImage standard example (with this url :“http://coronalabs.com/wp-content/uploads/2012/04/Corona_GamesPage_banner1.jpg”). It’s ok with corona sdk, but not with coronacards. Nevertheless, request responds fine, but there’s nothing on screen. When i want to get a remote .png (try “http://coronalabs.com/wp-content/uploads/2013/09/Physics2b.png”), then all is right ! Did i miss something with .jpg file ? or is it a bug ?

my code :

local function networkListener( event )

    if ( event.isError ) then

        print ( “Network error - download failed” )

    else

        event.target.alpha = 0

        transition.to( event.target, { alpha = 1.0 } )

    end

    print ( "event.response.fullPath: ", event.response.fullPath )

    print ( "event.response.filename: ", event.response.filename )

    print ( "event.response.baseDirectory: ", event.response.baseDirectory )

end

display.loadRemoteImage( ““http://coronalabs.com/wp-content/uploads/2012/04/Corona_GamesPage_banner1.jpg””, “GET”, networkListener, “testimage.jpg”, system.TemporaryDirectory, 50, 50 ) 

I’m asking Engineering if they know of any reason why this wouldn’t work, but I know they are going to ask for a bug report, so if you can put together a small sample that doesn’t work, complete with your Android project settings and any assets needed and zip it up and use the “File a bug” link at the top.   You will get an email with a case number.  Please post that back here when you get it.

Rob

Just to make sure, do you have the android.permission.INTERNET set in your AndroidManifest.xml file correctly?  It will not take it from build.settings for you.

Rob

yes i have. Loading remote .png images works fine.

Can you print out the values for the width and height of the image?  Have you tried taking off the setting of the alpha to 0 and the transition to bring it on the screen?

Can you use a table printing function (see: http://coronalabs.com/blog/2014/09/02/tutorial-printing-table-contents/) and try to print out event.target and see what values are there?

Rob

Hello Rob,

width => 1920 height => 1080 (.png & .jpg)

and yes i took off transition.

here is the .jpg response =>

02-13 10:17:33.106: I/Corona(17783): table: 0x7a65efb0 {

02-13 10:17:33.106: I/Corona(17783):   [fullPath] => “/data/data/com.example.coronatest/cache/tmp/image8.jpg”

02-13 10:17:33.106: I/Corona(17783):   [filename] => “image8.jpg”

02-13 10:17:33.106: I/Corona(17783):   [baseDirectory] => userdata: 0x77e360d2

02-13 10:17:33.106: I/Corona(17783): }

the same for .png =>

02-13 10:22:02.456: I/Corona(18710): table: 0x7a59af18 {

02-13 10:22:02.456: I/Corona(18710):   [fullPath] => “/data/data/com.example.coronatest/cache/tmp/image8.png”

02-13 10:22:02.456: I/Corona(18710):   [filename] => “image8.png”

02-13 10:22:02.456: I/Corona(18710):   [baseDirectory] => userdata: 0x77e360d2

02-13 10:22:02.456: I/Corona(18710): }

Have you filed the bug report yet?  It’s critical that you do so because with out it, engineering won’t have a way to track its progress.   Please build a small sample that demonstrates the problem complete with any assets (images, etc) needed to run the project, your config.lua, xcode project files, etc.  Compress the project into a .zip file and use the “Report a bug” link above.

When you get the email confirming the submission, please post the case # back to this thread as a reference.

Thanks

Rob

hi Rob,

I did it yesterday : Case 38893

A couple of things.  First, the engineers said the bug report was not a complete project, just a main.lua.  In the future when you file a bug report it must be a complete project.  You need to provide the everything needed to compile the app, AndroidManifest.xml, assets, etc.  We simply can’t re-create your project for you.

Any way, there were two things that was spotted:

display.loadRemoteImage( ““http://coronalabs.com/wp-content/uploads/2012/04/Corona_GamesPage_banner1.jpg””, “GET”,

Why do you have two sets of quotes around the string?  This likely produces a lua compile error which would prevent this from working.  You should fix this and try again.

Also you need to see if you can display the JPEG file using display.newImage or display.newImageRect to verify that the image itself is not corrupt.

Rob

Hi Rob and thank you,

  • Sorry for the mistake in the main.lua i posted in the bug report. In my project, there is just one set of quotes.

  • I tried to display my JPEG files in a classic way before posting here, No image corruption, works fine.

Actually, i just want to know if someone is able to load and display a remote jpg in coronacards android or not (quite easy to test).

Can you resubmit the bug (just reply to the email from the last bug report) and attach a full project that runs?  No double - double quotes, every thing we would need to just hit build and run on the project.

Hi Rob,

Engineers told me that this issue has been fixed and will be in build 2564 !

Thank you for your help !

I’m asking Engineering if they know of any reason why this wouldn’t work, but I know they are going to ask for a bug report, so if you can put together a small sample that doesn’t work, complete with your Android project settings and any assets needed and zip it up and use the “File a bug” link at the top.   You will get an email with a case number.  Please post that back here when you get it.

Rob

Just to make sure, do you have the android.permission.INTERNET set in your AndroidManifest.xml file correctly?  It will not take it from build.settings for you.

Rob

yes i have. Loading remote .png images works fine.

Can you print out the values for the width and height of the image?  Have you tried taking off the setting of the alpha to 0 and the transition to bring it on the screen?

Can you use a table printing function (see: http://coronalabs.com/blog/2014/09/02/tutorial-printing-table-contents/) and try to print out event.target and see what values are there?

Rob

Hello Rob,

width => 1920 height => 1080 (.png & .jpg)

and yes i took off transition.

here is the .jpg response =>

02-13 10:17:33.106: I/Corona(17783): table: 0x7a65efb0 {

02-13 10:17:33.106: I/Corona(17783):   [fullPath] => “/data/data/com.example.coronatest/cache/tmp/image8.jpg”

02-13 10:17:33.106: I/Corona(17783):   [filename] => “image8.jpg”

02-13 10:17:33.106: I/Corona(17783):   [baseDirectory] => userdata: 0x77e360d2

02-13 10:17:33.106: I/Corona(17783): }

the same for .png =>

02-13 10:22:02.456: I/Corona(18710): table: 0x7a59af18 {

02-13 10:22:02.456: I/Corona(18710):   [fullPath] => “/data/data/com.example.coronatest/cache/tmp/image8.png”

02-13 10:22:02.456: I/Corona(18710):   [filename] => “image8.png”

02-13 10:22:02.456: I/Corona(18710):   [baseDirectory] => userdata: 0x77e360d2

02-13 10:22:02.456: I/Corona(18710): }

Have you filed the bug report yet?  It’s critical that you do so because with out it, engineering won’t have a way to track its progress.   Please build a small sample that demonstrates the problem complete with any assets (images, etc) needed to run the project, your config.lua, xcode project files, etc.  Compress the project into a .zip file and use the “Report a bug” link above.

When you get the email confirming the submission, please post the case # back to this thread as a reference.

Thanks

Rob

hi Rob,

I did it yesterday : Case 38893

A couple of things.  First, the engineers said the bug report was not a complete project, just a main.lua.  In the future when you file a bug report it must be a complete project.  You need to provide the everything needed to compile the app, AndroidManifest.xml, assets, etc.  We simply can’t re-create your project for you.

Any way, there were two things that was spotted:

display.loadRemoteImage( ““http://coronalabs.com/wp-content/uploads/2012/04/Corona_GamesPage_banner1.jpg””, “GET”,

Why do you have two sets of quotes around the string?  This likely produces a lua compile error which would prevent this from working.  You should fix this and try again.

Also you need to see if you can display the JPEG file using display.newImage or display.newImageRect to verify that the image itself is not corrupt.

Rob