How do I copy an image into a thread?

I’m guessing it’s some kind of address forwarding?

This seems to be a recurring, if minor, headache. When we last discussed it in January, it turned out there were some business/hosting constraints making it difficult for the SDMB to support image & video pasting the “proper”, easy way: Can we consider allowing direct image uploads?

Nonetheless, this has been bugging me for the last few months.

I finally decided to try and do something about it, and made a Chrome/Firefox extension that will allow you to paste/upload media right into the textbox here, as Discourse intended:

Behind the scenes, though, it won’t try to upload that directly to the SDMB (which won’t work, as we saw here). Instead, it will upload it to an external host* and then just paste the URL here (that fightingignorance.org link). That lets Discourse manage the in-line preview functionality, as normal, without actually having to store the uploaded file on SDMB servers.

Would this be helpful to anyone else? If so, wanna help me beta test it? :slight_smile: I have a basic version working now, but it needs more polish & testing.


*The “external host” is just a cloud file hosting service (Cloudflare R2, a competitor to Amazon Web Services). I decided to put the images there because:

  • We don’t want to use any SDMB resources or incur any expenses for its current owners. R2 is cheap enough that it probably won’t cost much, if anything.
  • Doing it this way means it’s fundamentally the same thing as uploading a photo to an external site like Imgur/Photobucket/Shutterfly/Google Photos/etc. and then pasting the URL here.
  • Except this way, it’ll be easier to use and not require any logins or signups. It won’t have expiring URLs, annoying ads, etc. You’d just paste (or drag and drop, or click the upload button) right here as you’re editing the post, and the plug-in handles the rest for you.

Let me know if any of ya wanna try it out.

Sorry I was trying something here and got all messed up lol!

Wasn’t your fault, that’s the SDMB issue we’re talking about =/ Most Discourse forums let you just directly paste & upload images, but ours won’t…

I’d love to! Unfortunately, I use the Brave browser.

I gotta ask: whose R2 account does this extension use? Does it require the user to provide an API key, or does it use yours?

Cool, thanks! It might still work with Brave and other browsers. I’ll test it and let ya know ASAP.

Just mine, for now. From what I can tell, if only a few people end up using it, we can probably stay within the free tier for many years. If it ends up being a few dollars a month, I can pay for it. If it ends up being more than that, I’ll have to figure something out, maybe set up a donation bucket, and/or give people the option to sign up and put in their own free R2 key so they can have their own free 10 GB. I have several ideas about how to deal with that eventuality, but it’s probably not something we have to worry about right off the bat. The storage and bandwidth would just be for the SDMB, so we’re not sharing resources with any other forum or anything, and we can choose to enforce reasonable file size/quality limits (or not, depending on what people want, like whether posting videos should be allowed).

The extension itself will be free and open source, so anyone can do whatever they want with it. I can also extend it later to support other storage options (your own iCloud or GDrive or FTP or whatever), if there’s a demand for such things. Didn’t want to jump ahead though, just starting simple! If it actually ends up seeing usage here, we can figure out a way to collectively take care of it as a community, just to avoid the “hit by a bus” factor (not that I’m looking to add that to my bucket list).

I keep trying lol … I am just not fluent with image hosting sites.

I just tried posting one from facebook.

Posting images from Facebook doesn’t work very well here. Users here can’t see the image unless they are logged into Facebook at the time. If someone here doesn’t have a Facebook account then they can’t see the image at all.

I was simply tinkering. Trying to see if I can get something to work.

I’ve been trying Imgur but it has so many ads on my mobile that it’s hard to use.

I’ll keep working on it.

Imgur online also has ads but they stay out of the way.

ETA: just on the front page. On my account’s “posts” page, no ads at all.

It’s easier for me to post pictures from my phone although I know how to do it from my PC desktop. I might have to resort to the PC since I would have a much smoother ad free experience.

I was using the Imgur website on my mobile and almost accidentally installed Tik ToK lol :scream: :rofl:

I really don’t want to make an account as it will be one of those things I rarely use. I am trying to clean up my online presence and just hate the extra clutter of needing either an app or new log in/password data.

Test of image on google drive.

ETA: So that doesn’t work.

There’s no way to get Google drive to serve up just an image that’ll appear inline here. That’s my cloud storage provider & I’ve tried a lot of different ways. Google is determined not to allow that.

OK. How about iCloud?

I’m skeptical since it looks like it’s to a page.

ETA. Surprise. Surprise.

Essentially it’s that Discourse is picky about displaying anything but a recognized graphic format file. If the image you see is being generated dynamically (i.e., there is no stored image file, not even buried in the HTML code) then there’s nothing Discourse can do with it.

I had thought of doing something like this at one point but never got around to it. My idea has been to use an Imgur account as the host, and I never sat down and figured out their API.

It was really easy with R2. AI wrote the extension in a couple minutes, and I’ve been testing it myself for the last few weeks. It mostly works with some minor bugs. I’ll clean it up and release the code when I get back from a trip. Sorry for the delay!

Testing: