3

I was wondering how many posts have image(s) in them? Is it possible to query that?

This comes from trying to understand how much people care to put pictures in SO, and trying to gather data for discussions on this subject.

It's nice to take a side and form an opinion based on actual numbers.


Bonus: How are the numbers from regular SO and meta SO compared to each other?

Footnote: I'm not judging wether the images are good (diagram) or bad (screenshot of code), but in case that's to consider, maybe just counting images in answers (as they should not include as many code) I guess would be fine.

16
  • ... From meta.stackoverflow.com/questions/361361/…
    – Veve
    Commented Jan 3, 2018 at 14:24
  • I'm running SELECT COUNT(*) FROM Posts WHERE Body LIKE '%<img%' in SEDE. That will include posts where the <img> tag is inside code, but it'll give a nice base figure.
    – Glorfindel
    Commented Jan 3, 2018 at 14:25
  • @Glorfindel I was thinking something among those lines too, but I'll wait for the more experienced pros to do that, as I'm not actually qualified.
    – FirstOne
    Commented Jan 3, 2018 at 14:26
  • @Glorfindel but wouldn't that include codes that consists of it? Not really images...
    – FirstOne
    Commented Jan 3, 2018 at 14:27
  • We can further limit to look for like '%//i.stack.imgur.com%' to only include the images provided via SO's editor. This would probably handle the vast majority of cases without code conflicts. @Glorfindel
    – ryanyuyu
    Commented Jan 3, 2018 at 14:27
  • Yeah. As I mentioned, I'm not qualified for this. It would be nice if people post answers so we can see the different approaches.
    – FirstOne
    Commented Jan 3, 2018 at 14:28
  • I would also exclude closed questions (maybe limited to "why isn't this code work" as the closing reason), since they can identify questions with improperly used images (e.g. images of code).
    – Tom
    Commented Jan 3, 2018 at 14:30
  • Seeing how people reacted to this in the comments, I'd say they are willing to participate in this and know the results. As this' yet to receive a comment against, so it would be nice to see the pov of the downvoter as to why this is useles ^^.
    – FirstOne
    Commented Jan 3, 2018 at 14:43
  • 1
    @FirstOne: Don't worry too much about downvotes on Meta.
    – Cerbrus
    Commented Jan 3, 2018 at 14:44
  • @Cerbrus I'm not. But such question with not text response is pretty ambiguous (vote-wise).
    – FirstOne
    Commented Jan 3, 2018 at 14:50
  • 2
    Too many. Saw a good answer with an animated gif this morning, could not bring myself to vote for it. Odd phenomena lately btw, seems there is an entire new generation that never had their eyes assaulted by web v1.0 Commented Jan 3, 2018 at 14:51
  • @HansPassant: Oh 1.0... Blink and you missed it. (I wish)
    – Cerbrus
    Commented Jan 3, 2018 at 14:52
  • As other people said, do not fret votes in Meta (or in main, for that matter). Possible reasons for downvotes that I can think of: dowvoters could feel that you could have conducted your own research, that the number of images is not important and it could be argued that is almost impossible to derive a meaningful reading from this data, that no actionable course is proposed in the question, that Tim lost his keys, etc. Personally, I do not have a dog in this fight. I vote +0 meh. :P
    – yivi
    Commented Jan 3, 2018 at 15:17
  • Good Lord, this question is expanding :) @HansPassant , was it this question .. stackoverflow.com/questions/46354842/… ? Which question was it?
    – Fattie
    Commented Jan 3, 2018 at 21:14
  • I don't see how you can even ask a question like this .. stackoverflow.com/questions/37698636/… (random search example from 100s) without using an anime, video or whatever. There seems to be some confusion here, it would be as if someone said "let's use 'Text' on SO" and you blokes said "oh, boy, that 'text' stuff is used in those internet cat meme things - let's not have that!" :)
    – Fattie
    Commented Jan 3, 2018 at 21:16

1 Answer 1

7

As there are so many posts on Stack Overflow already, SEDE queries to analyze this often time out. Therefore, I looked at the posts from last December, as it's the ratio that matters most.

According to this SEDE query, of the 390k posts created in December 2017, 22k or 27k (depending on what you count) have images (or something that looks like an image) in them. That amounts to 5.7% resp. 7%.

For Meta Stack Overflow, the numbers are 167 (with images)/870 (total) = 19%.

You can play around with the dates to see if there's a trend, but if you choose a large enough interval, the query will time out.

9
  • 1
    I would add to this answer what you consider to be "having images in them".
    – FirstOne
    Commented Jan 3, 2018 at 14:33
  • 1
    @FirstOne 5.7% contains i.stack.imgur.com and 7% contains <img . IMO, the linked SEDE query already provide a ton of details
    – Taku
    Commented Jan 3, 2018 at 14:35
  • 1
    @abccd I'd say we consider the SEDE link as any other link: questions should include any necessary information - and limiting what's considered an image is important, imo.
    – FirstOne
    Commented Jan 3, 2018 at 14:39
  • 3
    @FirstOne: SEDE is a Stack Exchange resource. One that won't go down while Stack Overflow is still standing. So SEDE isn't considered an "external" resource.
    – Cerbrus
    Commented Jan 3, 2018 at 14:40
  • You could just do a site search of url:i.stack.imgur.com and optionally apply created or is:q and is:a etc... Commented Jan 3, 2018 at 21:08
  • eg: url:i.stack.imgur.com created:2017-12 gives you 27,809 results and taking off the created filter gives you 1,319,128 results Commented Jan 3, 2018 at 21:12
  • That'd work but it 1) includes images linked as plain text 2) excludes images from external sources and 3) cannot be combined within SEDE results. But it's good to have it as another source (especially as the OP was concerned SEDE isn't reliable enough).
    – Glorfindel
    Commented Jan 3, 2018 at 21:15
  • @Glorfindel given it seems consistent with SEDE, is more representative of those uploading images and I imagine given the purpose of it being an indicator of how many images there are - even if it's a couple of percent out of being totally accurate (whatever that means in this context) shrugs Commented Jan 3, 2018 at 21:24
  • Looks like in December - 25,328 questions with a potential image were created, 21,528 remain after removing deleted ones and 20,395 are still open... Commented Jan 3, 2018 at 21:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .