News:

Wondering if this will always be free?  See why free is better.

Main Menu

Copy and Paste Images into Posts

Started by Dave En Velo, January 23, 2021, 04:12:12 PM

Previous topic - Next topic

Dave En Velo

I do not claim to be an expert in SMF or its Mods but as far as I can see there is no simple way to Copy an image (or part of an image) and Paste it into SMF.  This is something that has been in Word, Excel and many other applications in Windows forever.  It makes construction of documents with images a trivial exercise. 

As a Post(er) to SMF sites I would like to do the same.  I would like to use a tool of my choice, Photoshop, Paint Snip & Sketch, ... to copy an image (or part of an image) to the Clipboard and Paste it into my Post.  At the moment my best option is to Paste the image into an application, eg Photoshop, then save the file, then upload the file as an attachment, Post my post, view my post and copy the link address of the attachment, modify my post to put the image where I want in the post using IMG tags and the link address.  The resulting post looks fine, although the attachment at the end looks a bit odd.

So I can do what I want with version 2.0.17 and I assume the same is true with 2.1.  However, it is cumbersome to say the least and makes SMF look very, very dated.

I think that SMF desperately needs this functionality but reading these requests for new features I cannot see it arriving anytime soon.  So I have been thinking about what could be done to add this functionality without impacting core SMF or needing a mod.  My suggestion is as follows:


  • Create a web page with a single button marked "Replace Clipboard image with corresponding SMF IMG tags".
  • When the button is clicked the web page accesses the Clipboard and saves the image out in the Cloud and records the URL
  • When the save is complete the web page rewrites the Clipboard with the URL between IMG tags and returns DONE to the user.

My understanding is that Clipboard access is being, or has been, enabled for most browsers.  So this approach looks possible.  There are security issues but they do not look insurmountable.  Saving files to the Cloud is certainly not rocket science.  This is probably relatively simple code but beyond my current capabilities.

So when a user has Copied an image they wish to put in an SMF Post they click on another tab in their browser and click "Replace Clipboard image with corresponding SMF IMG tags".  When they see DONE they click back to the SMF Post and Paste the IMG tags where the image is required.

The merits of this approach are:

  • Copy and Paste of images into SMF Posts is relatively quick and straightforward.
  • Images (unlike those in attachments) are not stored on the SMF site but in an area managed by the user.
  • An initial implementation might use the user's Dropbox or Google Cloud but this could be configurable so that any cloud provider could be used.
  • No changes to SMF, no mod required.

If the approach I am suggesting is as feasible as I suggest then a later enhancement would be to add the "Replace Clipboard image with corresponding SMF IMG tags" button to the Posting page in SMF so that Copy and Paste of images into SMF Posts is truly trivial (as it should be).  Could be a change to core SMF or a mod.

Embellishments to such an approach would be optional re-sizing of images before upload to the Cloud and optional width and height on the IMG tag.

Of course if a "Replace Clipboard image with corresponding SMF IMG tags" cannot be implemented on a web page then a program could be written to do the same thing - although different versions might be required for different platforms.  However, I strongly feel that something needs to be done to plug this glaring hole in SMF functionality.

vbgamer45

I will work on this for SMF 2.1 as an addon.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Kindred

Well, while it's good to see  vbgamer will work on a mod, I would argue with your statement that this "is a glaring hole in smf " since no communication software that i work with allows a paste if an image from clipboard... and that includes Microsoft's own Teams product.

There is already a mod for in line attachments, and it's standard in 2.1... but paste from clipboard? Nope...  not something that browsers or even social media sites do.

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Aleksi "Lex" Kilpinen

I've seen many drag & drop solutions on different platforms, but can't really say I'd remember ever seeing exactly this either.
Word, excel and so on are a different thing all together, as clipboard was originally designed to move data within one closed environment - and in locally run Office programs that is exactly what it is still doing.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

vbgamer45

For 2.1 maybe to look into https://www.sceditor.com/posts/drag-drop-upload-demo/  I was working on this ran into one issue trying to debug javascript.
That copies to imgur but you could save to attachments instead. And there can be copy paste support as I am looking at the code.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Dave En Velo

I have just tried out vbgamer45's drag-drop-upload-demo and it contains the the kind of Copy/Paste functionality that I am looking for.  I Copied part of an image out of Photoshop Elements and Pasted it into a Posting with a few trivial clicks.  I was also able to reverse the process and select an image in the Posting, Copy it and Paste it into Word.

I assume this is a byproduct/feature of demo code to implement drag and drop of image files, certainly Drag and Drop of image files works fine.  I did try to Drag a selected image from Word and Drop it on the Posting but that just resulted in an empty outline in the Posting.  Frankly I was not expecting that to work as I am not sure what I expected.

I am currently a 2.0.17 user and I have been put off attempting to move to 2.1 because I didn't see the benefit to my users and the Release Candidate status was a concern.  However, if Copy/Paste of images is in the editor that's a real driver to upgrading, I will look out for this feature.

Thanks

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

GigaWatt

Quote from: Kindred on January 23, 2021, 09:07:12 PM
There is already a mod for in line attachments, and it's standard in 2.1... but paste from clipboard? Nope...  not something that browsers or even social media sites do.

FB Messenger does... don't know about FB, haven't tried it.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

d3vcho

Quote from: Kindred on January 23, 2021, 09:07:12 PM
There is already a mod for in line attachments, and it's standard in 2.1... but paste from clipboard? Nope...  not something that browsers or even social media sites do.

Yup, this is not true. You can do it in Twitter, WhatsApp, Telegram, Discord... It's a fancy feature and it's very handy for when you take a screenshot and want to send that screenshot without having to save it to your computer. There are some programs that allow you to keep a screenshot in your clipboard, for example, Lightshot.
"Greeting Death as an old friend, they departed this life as equals"

GigaWatt

Well... seems like that joke about the user that tried to paste an image in a plain txt file isn't going to be funny pretty soon :P :D.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Advertisement: