Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Extract all images from browser

Post Reply
RaelB
Posts: 26
Joined: Sun Feb 12, 2017 11:22 am

Extract all images from browser

Post by RaelB »

Hello,

Do you have any suggestions/advice on how to extract all images that have been loaded in the browser, i.e. image content, not (just) image name.

Thanks
Rael
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Extract all images from browser

Post by salvadordf »

Hi,

I've never tried it but I guess you can do this :
  • Leave the GlobalCEFApp.cache blank to use "in-memory" cache.
  • Use the TChromium.OnBeforeResourceLoad event while the web page is loading and store all the image URLs. Check that the request.ResourceType property is RT_IMAGE.
  • Use the TChromium.StartDownload function to download each stored image URL. The download should be instantaneous because TChromium will save the copy in the memory cache.
You will miss all these :
  • Images drawn in a canvas.
  • Images drawn piling up DIVs with a background color or stretched pixels.
  • Images drawn using unicode characters with fonts loaded from the Internet.


Remember that the SimpleOSRBrowser demo has a "snapshot" button to save the whole web page as an image.
RaelB
Posts: 26
Joined: Sun Feb 12, 2017 11:22 am

Re: Extract all images from browser

Post by RaelB »

Thanks. Interesting strategy. Not instantaneous if there are a lot of images, but still works well.

Thanks
Rael
Post Reply