-5

When I try to insert an image into my Stack Overflow question with this link to an image hosted on LightShot (like this one) I got an error:

Screenshot of image uploader pane in post editor, with the input bordered in an error state with the error text "Failed to upload image; an error occurred on the server

Is this not a valid way to upload and show my image? Which way is valid?

9
  • 2
    What happens when you just paste the image into the question box?
    – Thom A
    Commented Oct 16, 2023 at 18:33
  • 4
    Are you also sure that link is to the image and not the webpage (like the one in this question).
    – Thom A
    Commented Oct 16, 2023 at 18:34
  • 11
    Yep, prnt.sc/CI1B-BLgnohX isn't an image, it's a webpage. You can't upload a webpage as an image.
    – Thom A
    Commented Oct 16, 2023 at 18:38
  • 2
    Not to mention, as a user of over 2K should already know: Please do not upload images of code/data/errors when asking a question.
    – Thom A
    Commented Oct 16, 2023 at 18:38
  • 3
    @ThomA they are not posting an image of code, but a screenshot of their IDE, in relation with a question they asked about it.
    – yivi
    Commented Oct 16, 2023 at 18:49
  • 3
    Or you could just upload the image directly from your computer rather than using a third-party host to begin with. Commented Oct 16, 2023 at 18:52
  • 1
    There's a lot of code in that picture in my opinion, @yivi , and most code is written in an IDE, so many screenshots of code *are" also of IDEs
    – Thom A
    Commented Oct 16, 2023 at 18:56
  • 6
    And still, it’s not a “picture of code” @ThomA. It’s just a screenshot from their IDE , they posted a question about “search and replace”. In any case, none of ruis is relevant to this question.
    – yivi
    Commented Oct 16, 2023 at 18:58
  • 1
    The "Why should I not upload images of code/data/errors?" Policy also applies to this current Question on 'Meta' anyway...: The (rather vague) "Failed to upload image: an error occurred on the server" Error Msg should still be included as Text and not only visible from the Screenshot... [Can't do it myself, <2k-Rep, (suggested) Edits not allowed on 'Meta'...]
    – chivracq
    Commented Oct 17, 2023 at 11:45

2 Answers 2

10

Like @yivi said, you need the actual image URL, not the link to LightShot– but unfortunately, getting that link from LightShot appears to be very confusing, and not easily accessible.

You're looking for this URL:

https://img001.prntscr.com/file/img001/A_2g8dPASJWADWcVXJV7Fg.png

For a better experience in the future, you may want to find another way to capture screenshots without using LightShot (Especially since all images you upload with this service are publicly accessible, whether you intend them to be or not).


Using traditional means on the LightShot website, like attempting to copy the image address or open it in a new tab from a browser's context menu, just leads you back to the same page:

GIF of the LightShot website showing that the link generated by either copying the image address or opening the image in a new tab just leads you back to the LightShot page

The only way I could obtain the actual URL for your image was by digging into the page's markup with browser dev tools to find the image's underlying source (underlined here in green):

HTML markup of the image pane on the LightShot website, with the actual image URL underlined in green

Uploading that URL works just fine:

GIF of the successful upload process using the new URL

But that's a lot of work to dig up one image!

Like I said above, you probably want to find another way to capture and share screenshots, without using LightShot, that's more controllable, intuitive, and which doesn't allow anyone to view or scrape your uploaded screenshots by design.

5
  • Can you advice such another way ?
    – mstdmstd
    Commented Oct 16, 2023 at 19:53
  • 5
    @mstdmstd if you are on Windows just use snipping tool. Regardless of the OS, the print screen key on your keyboard should be useful as well. Commented Oct 16, 2023 at 19:57
  • 1
    @AbdulAzizBarkat Or even simpler (than manually starting the snipping tool): Shift+Win+S Commented Oct 17, 2023 at 8:44
  • On Linux, Ctrl + Shift + PrtSc to get onto the clipboard (on a non-crippled keyboard and depending on the desktop environment) Commented Oct 17, 2023 at 20:39
  • My personal favorite, on Windows, is to use ALT + print screen. That dumps the active window to the clipboard rather than the entire desktop (which might be wider than one screen...). Less hassle than the snipping tool, IMO. I tend to want to do a little extra cropping, obfuscating, resizing or maybe annotating in a simple paint editor anyway.
    – Gimby
    Commented Oct 18, 2023 at 13:53
9

You should use a direct link to an actual image.

The link you are using is a link to a webpage, with the image embedded.

You must log in to answer this question.

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