Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Displaying a Remote Image - Network library Limitation
Started by aclementerodrguez Jul 11 2019 09:42 PM

- - - - -
4 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

aclementerodrguez

[GLOBAL: userInfoPane.html]
aclementerodrguez
  • Enthusiast

  • 44 posts
  • Corona SDK

Hi there,

 

I want to load a remote image via http(s) and display it in my HTML5 app, but I have this limitation:

 

I can't save the image in my host.

 

So, if the methods that Corona ( network.requestnetwork.loadRemoteImage and network.dowload ) provides requires the filename property that will be the file to which the response will be saved, how can I doing this?



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Corona Geek

  • 1,034 posts
  • Corona SDK

If your host completely prevents you from saving any files, even temporarily, then you can't use remote images as is.

 

You could, technically, convert the image that you want to send into JSON (or have a vector image's definitions) and use that JSON data for creating a raster JPG/PNG, but this is far from a trivial task.



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,408 posts
  • Enterprise

Can you find another web hosting service or photo sharing service, like Flickr, anything that you can get a URL to?

 

Rob



[TOPIC: post.html]
#4

aclementerodrguez

[GLOBAL: userInfoPane.html]
aclementerodrguez
  • Enthusiast

  • 44 posts
  • Corona SDK

If your host completely prevents you from saving any files, even temporarily, then you can't use remote images as is.

 

You could, technically, convert the image that you want to send into JSON (or have a vector image's definitions) and use that JSON data for creating a raster JPG/PNG, but this is far from a trivial task.

Ok, thanks a lot!



[TOPIC: post.html]
#5

aclementerodrguez

[GLOBAL: userInfoPane.html]
aclementerodrguez
  • Enthusiast

  • 44 posts
  • Corona SDK

Can you find another web hosting service or photo sharing service, like Flickr, anything that you can get a URL to?

 

Rob

 

I really don't understand you... I already have a URL, but how I can reference the image if it need to be host in my own directory.

According to the sintaxis in the network listener an image can be display it like this:

 

display.newImage( event.response.filename, event.response.baseDirectory, 60, 40 )

 

and the baseDirectory needs to be the same of my app




[topic_controls]
[/topic_controls]