Hi all,
So I have loaded a web page in a browser, and I can get the source to it from my Lazarus code and parese the source. But since the page is loaded and rendered it will have also loaded the images from the website. Is there a way to get the properties of those images programattically e.g. filesize, resolution etc?
Cheers.
Phill.
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.
How do I.....
- salvadordf
- Posts: 4580
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How do I.....
Hi,
As far as I know there's no way to know the image properties before downloading them.
You can read the "Content-Length" HTTP header once the download starts but the resource length is not what you asked.
The image attributes in HTML are not always available and the downloaded image can have much different size values.
The only solution I know is to download the image file in order to get the real width, height, etc.
As far as I know there's no way to know the image properties before downloading them.
You can read the "Content-Length" HTTP header once the download starts but the resource length is not what you asked.
The image attributes in HTML are not always available and the downloaded image can have much different size values.
The only solution I know is to download the image file in order to get the real width, height, etc.