Warning pop up when there is a picture detected in a post

When someone creates a new post you get the little " Your topic is similar to…", is it possible to have anything additional in there?

Specifically it’d be great if we could somehow detect if a picture is being embedded in a post and then prompt users with something like “Please don’t post pictures of text, logs or code. They are difficult to read, impossible to search and replicate (if it’s code), and some people may not be even able to see them”

For us, we do get posts that have UI elements that need screenies, but we also get a lot more cases of users posting screenshots (or photos of screens!) of things like config or log files, or other text mediums.

7 Likes

Yeah, I feel your pain on this one. That said, I feel like people posting screenshots are a million times ahead of people saying they have a problem with no explanation or record at all. I don’t have a solution, but I feel like something to OCR the images is going to be more productive than chastising people for trying…

4 Likes

Technically it is possible to do something here using some AI integration, but getting in fast enough would be a challenge.

Here is a somewhat old post about this:

Some more ideas would be:


Perhaps a super rough plugin here that “could get the job done ™” would be to automate tesseract:

Pass it the image → get text → look at total number of letters → if more than N you know it is very likely a code snippet. Then we can warn prior to posting.

I think this is reasonably feasible in a plugin.

4 Likes

Would it be easier to put a hook in so that when someone clicks the upload button, or drags+drops a pic that then provides the pop up?

Certainly doable, this kind of functionality though would have to be in a plugin. Especially depending on the implementation.

Something like tesseract is a beast to install, it is a bit of a cross road. You either end up standing up a new API or you pollute your application container. By standing up an API you get better isolation, but then whoever installs this kind of plugin (outside of our hosting) would have to configure and stand up a second container to do this work.

We would need to be very careful with timeouts (what if it takes 10 seconds to figure out its a screenshot of code, what does the user see?)

My off-the-cuff brainstorming here would be something like

  • user post image
  • image shows up in post
  • (concurrently) post is sent to “detect if this is a code screenshot” service
  • when the service eventually responds you show the warning

Blocking all uploads of images on a service (even if local) is risky cause the end user experience can suffer quite a bit.

You could do one “final” delay I guess just before posting to ensure nothing is left in the queue.

This is all potentially feasible work we could take on, but we would need a data set to work with first so we can set expectations (say 50 code snippet images … 50 not code snippet images)

It is a super fuzzy problem, so examples would help ground how well this thing could behave.


An interesting twist would be if this magic service “de-screenshotted” the source code and let the user know … “hey, I can see you tried to post some source code here, would you like me to change it to this block of text”

2 Likes

Like the OCR plugin but maybe a bit more user friendly :wink:

2 Likes

I don’t think OP is asking to look at the content of the image, just show a helpful notice whenever any image is being included in the post about screenshots etc.

That’s like v1. “AI to look for text” is like v10.

2 Likes

yeah that’s pretty much it mate

1 Like

An atomic warning gated by trust level (and possibly post count) is pretty straightforward in a theme component, could get quite annoying depending on the forum

1 Like