# Is there a way to crawl image size (pixel)

**URL:** https://discuss.httparchive.org/t/is-there-a-way-to-crawl-image-size-pixel/1423
**Category:** Analysis
**Created:** [July 31, 2018, 8:48pm UTC](https://discuss.httparchive.org/t/is-there-a-way-to-crawl-image-size-pixel/1423 "2018-07-31T20:48:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![loonybear](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@loonybear](https://discuss.httparchive.org/u/loonybear)
#### Post date: [July 31, 2018, 8:48pm UTC](https://discuss.httparchive.org/t/is-there-a-way-to-crawl-image-size-pixel/1423/1 "2018-07-31T20:48:41Z")

</div>

Hi I am trying to run some analysis on image data. More specially I want the image’s type, file size, and image size.

I managed to get the first two simply by querying a requests table:

SELECT  
respSize,  
mimeType  
FROM  
[httparchive:runs.latest\_requests]  
WHERE  
mimeType CONTAINS ‘image’  
LIMIT  
1000000

But is there a simple way to get the image size? Or I will have to fetch each image myself to achieve so?

Thanks

---

<div class="post-metadata">

### Author: ![doug\_sillars](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.httparchive.org/doug_sillars/32/1297_2.png) [@doug\_sillars](https://discuss.httparchive.org/u/doug_sillars)
#### Post date: [July 31, 2018, 9:25pm UTC](https://discuss.httparchive.org/t/is-there-a-way-to-crawl-image-size-pixel/1423/2 "2018-07-31T21:25:26Z")

</div>

Hi,  
The Archive does not have the image dimensions, but you could get the image url, and then query the urls with imagemagick:

`magick identify http://res.cloudinary.com/dougsillars/image/upload/v1532673490/IMG_20150625_192917267_o4bvyk.jpg`

gives the response:  
`http://res.cloudinary.com/dougsillars/image/upload/v1532673490/IMG_20150625_192917267_o4bvyk.jpg=>IMG_20150625_192917267_o4bvyk.jpg JPEG **4160x2340** 4160x2340+0+0 8-bit sRGB 2655710B 0.000u 0:00.049`

so something like:  
xargs -n 1 magick identify \< listofimageurls.csv -of csv \>\> output.csv  
will query all of the urls, and give you a formatted CSV with the data you are looking for. You might even optimise the imagemagick query to get more detailed information about each image.

Also - [httparchive:runs.latest\_requests] is no longer updated, and will be data from February 2018. You want to be using httparchive:summary\_requests.2018\_07\_15\_mobile (or desktop) to look at recent requests for images.

Doug
