Hi,
I have tens of thousands of image URLs. I would like to obtain rough statistics about their width and height.
I don't need the actual images.
I can code in several languages.
I would appreciate any tips.
Ben
Image statistics on thousands URLs
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image statistics on thousands URLs
Code: Select all
convert -ping URLtoImage -format "%wx%h" info:
URLs of the form http://..../someimagename.suffix
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Image statistics on thousands URLs
If any of the images are multi-layer GIFs, the info format might be a little more helpful by adding the filename and the position of the image in the stack to the output. This command...fmw42 wrote:Code: Select all
convert -ping URLtoImage -format "%wx%h" info:
Code: Select all
magick http://radar.weather.gov/Conus/Loop/NatLoop.gif -ping -format "%[w]x%[h]" info:
Code: Select all
3400x16003350x15353351x15333345x15253354x15173355x15183356x15123356x1518
Code: Select all
magick http://radar.weather.gov/Conus/Loop/NatLoop.gif -ping -format "%[f][%[p]] %[w]x%[h]\n" info:
Code: Select all
NatLoop.gif[0] 3400x1600
NatLoop.gif[1] 3350x1535
NatLoop.gif[2] 3351x1533
NatLoop.gif[3] 3345x1525
NatLoop.gif[4] 3354x1517
NatLoop.gif[5] 3355x1518
NatLoop.gif[6] 3356x1512
NatLoop.gif[7] 3356x1518
Code: Select all
magick http://radar.weather.gov/Conus/Loop/NatLoop.gif[0] -ping -format "%[w]x%[h]" info:
Code: Select all
3400x1600
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image statistics on thousands URLs
Good point Geemack.
But my understanding is the -ping must come before the input to avoid reading the image.
But my understanding is the -ping must come before the input to avoid reading the image.
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Image statistics on thousands URLs
Thanks. I ran a couple tests with URLs pointing to some large JP2 files from NASA and a multi-layer GIF from NOAA, and it looks like you're correct. In every case it was notably faster when putting the "-ping" ahead of the URL.fmw42 wrote:But my understanding is the -ping must come before the input to avoid reading the image.