0

I am new to web development; this may be a very stupid question to ask you but I have lost 1-2 days trying to resolve this problem by trying multiple solutions (Internet search).

I have a regular HTML page with an image (just regular <img /> HTML tags) which is loading from a URL. That URL always gives me a new image (due to website security reasons). I want to show that image anywhere else so I'd like to get its content, base64 encoded preferably, without the need to re-download the image (i.e. it's already loaded by the browser, so now I want the content).

How can I achieve this?

freginold
  • 3,946
  • 3
  • 13
  • 28
  • 1
    I'm not sure I understand. What do you mean by "gives me always a new image"? Are you saying the URL for the images is always different? And what do you mean by anywhere else? Also we have no idea who "they" are when you say "I'd like to get their content". We also don't know what content they are providing, or how it is being provided/saved. I'm not certain, but it seems you have multiple issues you need help resolving. Please clarify so I can help further. – Aaron Eveleth Sep 25 '17 at 19:47
  • [Use `canvas` to do that](https://stackoverflow.com/questions/22172604/convert-image-url-to-base64). However, the image must be from the same origin due to the browser's same-origin policy. – Terry Sep 25 '17 at 19:47
  • Can we get that url? – Carlitos Sep 25 '17 at 19:49
  • ~That's a duplicate, always... –  Sep 25 '17 at 19:52
  • i am loading a image in tag from some URL and i want to show that particular image in another image tag – Shivam Kumar Sep 25 '17 at 19:52
  • sorry i cant provide you coz every Urls always coming from server side and every url have multiple images – Shivam Kumar Sep 25 '17 at 19:55
  • https://stackoverflow.com/questions/934012/get-image-data-in-javascript i had tried it but this is not working for me – Shivam Kumar Sep 25 '17 at 19:56

0 Answers0