SMF Development > Feature Requests

Copy and Paste Images into Posts

(1/2) > >>

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.

I will work on this for SMF 2.1 as an addon.

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.

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.

For 2.1 maybe to look into  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.


[0] Message Index

[#] Next page

Go to full version