Allow to paste IMGs from the clipboard as attachments

https://www.phpbb.com/ideas/
User avatar
3Di
Former Team Member
Posts: 13686
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Allow to paste IMGs from the clipboard as attachments

Post by 3Di » Sun Sep 10, 2017 2:06 am

Like github, so to speak.

Has become very tedious to save the file etc while you are in a hurry - and instead to post a link which the most of users just don't bother to click on it.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

User avatar
_Vinny_
Style Customisations
Style Customisations
Posts: 8341
Joined: Tue Aug 11, 2009 12:45 am
Location: Brazil
Name: Marcus Vinicius
Contact:

Re: Allow to paste IMGs from the clipboard as attachments

Post by _Vinny_ » Sun Sep 10, 2017 5:09 am

plupload still does not support this feature. :|

User avatar
3Di
Former Team Member
Posts: 13686
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Allow to paste IMGs from the clipboard as attachments

Post by 3Di » Sun Sep 10, 2017 6:10 am

plupload has become to be more a PITA than anything else lastly.
Maybe it's time to look forward.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16981
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David ColΓ³n
Contact:

Re: Allow to paste IMGs from the clipboard as attachments

Post by DavidIQ » Sat Sep 16, 2017 11:15 pm

What would the alternative be?
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
3Di
Former Team Member
Posts: 13686
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Allow to paste IMGs from the clipboard as attachments

Post by 3Di » Sun Sep 17, 2017 3:44 am

Using some thing different, maybe Jquery. I read may be a security issue for javascript.
Over there at the plupload repo there is a feature request opened since 2014, so no hope.
No valid alternatives found till now.
Just curious to know what github itself uses to achieve that.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

User avatar
AmigoJack
Registered User
Posts: 5571
Joined: Tue Jun 15, 2010 11:33 am
Location: γ‚°γƒͺーン ヒル ゾーン
Contact:

Re: Allow to paste IMGs from the clipboard as attachments

Post by AmigoJack » Tue Oct 17, 2017 8:14 am

The worst thing about censorship is β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
Affin wrote: ↑
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.


User avatar
3Di
Former Team Member
Posts: 13686
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Allow to paste IMGs from the clipboard as attachments

Post by 3Di » Thu Jan 10, 2019 12:58 pm

Senky wrote: ↑
Thu Jan 10, 2019 12:47 pm
There is Clipboard Image extension out there now.
Any particular reason you haven't posted it for in the extension forum in development yet?
You probably need feedback on how it works so you can possibly improve it.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«


User avatar
3Di
Former Team Member
Posts: 13686
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Allow to paste IMGs from the clipboard as attachments

Post by 3Di » Thu Jan 10, 2019 1:08 pm

Senky wrote: ↑
Thu Jan 10, 2019 1:01 pm
It was already discussed here:
viewtopic.php?f=496&t=2432136
Extension Requests forum is NOT for extensions in development, you should know. :P
Moreover, less audit there than in the right one. ;)

Back on my idea, this one should be natively IMHO implemented in the core code and not as an extension.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 16981
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David ColΓ³n
Contact:

Re: Allow to paste IMGs from the clipboard as attachments

Post by DavidIQ » Thu Jan 10, 2019 1:11 pm

Extension developers are free to create extensions that will never be sent to the Customisations DB. In fact they can even submit those for CDB review as is without creating a topic for any feedback in the Extensions in Development forum. While it is encouraged to create such topics for feedback and testing to iron out any kinks before submitting for review, it is more a suggestion and not a requirement.
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.

User avatar
3Di
Former Team Member
Posts: 13686
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Allow to paste IMGs from the clipboard as attachments

Post by 3Di » Thu Jan 10, 2019 1:14 pm

Indeed, I suggested to do it because I am quite sure there will be something to improve there, if possible. :)
3Di wrote: ↑
Thu Jan 10, 2019 12:58 pm
Any particular reason you haven't posted it for in the extension forum in development yet?
You probably need feedback on how it works so you can possibly improve it.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity ΒΊ PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
πŸ‘¨β€πŸ« | Take a tour to | The Studio | πŸ‘¨β€πŸ«

User avatar
EA117
Registered User
Posts: 607
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Allow to paste IMGs from the clipboard as attachments

Post by EA117 » Thu Jan 10, 2019 3:19 pm

3Di wrote: ↑
Thu Jan 10, 2019 1:08 pm
Back on my idea, this one should be natively IMHO implemented in the core code and not as an extension.
If you're taking comments from the peanut gallery, I wholeheartedly agree with that, too. Both in terms of how "passive" and "light weight" the implementation needed is, and also because it deserves to live along side the drag-n-drop support that is implemented as native to phpBB as well. It is an "ease of use" story that can be readily supported for the platforms that will expose image data through the Javascript clipboard event.
I would agree with a reduction in value if that limitation were true, too. But I think the stackoverflow.com discussion cited is conflating two different things, and is the subject of a similar clarification that was mentioned in the discussion thread Senky referenced as well.

This new extension implements the ability to retrieve image data from the clipboard. This works -- and by definition of Windows clipboard standards must work -- regardless of whom was responsible for putting the image data into the clipboard. It cannot "only work for images copied from other pages is the browser."

Only if an application cannot or is not willing to render a compatible image format (e.g. device independent bitmap) as part of the clipboard image formats it offers would "an image" not be available to paste. But it would not be available to paste in more circumstances than just this phpBB extension, an in more circumstances than just web browser-related use cases.

My expectation is that stackoverflow.com description cited is from someone who actually attempted to copy & paste a file from their desktop, not withstanding that they legitimately describe this operation as "copy an image from the desktop." Meaning, same as you can select a file on your desktop (image or otherwise), perform a Copy or Cut operation, and then Paste that file into a different folder -- they tried to make the Javascript clipboard event the target of the Paste operation in that scenario.

But this scenario does not put image data into the clipboard, which is why image data is then subsequently not available for Paste.

What is in your clipboard at that point is a file path reference, similar to a file drag-n-drop operation, which is usable essentially only to SHELL32 / Windows Explorer or applications able to support inserting "a link to a file" (not it's content). There isn't even a plain text rendering of the file path available from the clipboard, which you can prove by trying to Paste that "file" into Notepad. You'll get neither the path to the file currently in the clipboard, nor (in the case of it being a text file) the contents of that file, either.

So the fact that "copy a image file from my desktop, and then try to paste it into my web browser where clipboard image data is supported" ultimately doesn't work is expected for that scenario. That doesn't represent a case where image data will be in the clipboard, and won't work in any case where image data was expected from the clipboard. Not just here with this extension, and not just with Javascript browser support in general, either.

But if you do want to use a file instead of image data to create an attachment in phpBB, you can either drag it to phpBB, or use the phpBB "Attach" button.

Putting image data into the clipboard -- from any application, not just a web browser -- is what Senky's new extension successfully enabled. e.g. You can be viewing or editing an image in Photoshop, or in MSPaint, or from an open Word document, or simply creating a screen shot of your current screen -- or yes, from an image you're looking at in a browser window, too -- and then just copy and paste that image into a phpBB message. Without ever saving that image "as a file", and without it ever existing "as a file."

User avatar
AmigoJack
Registered User
Posts: 5571
Joined: Tue Jun 15, 2010 11:33 am
Location: γ‚°γƒͺーン ヒル ゾーン
Contact:

Re: Allow to paste IMGs from the clipboard as attachments

Post by AmigoJack » Thu Jan 10, 2019 4:40 pm

EA117 wrote: ↑
Thu Jan 10, 2019 3:19 pm
I would agree with a reduction in value if that limitation were true, too.
I tested it today myself using Chrome, seeing my OS clipboard image being rendered in the internet browser's website upon pressing CTRL+V. Which is new to me. Maybe the limitation being discussed 2.5 years ago really existed back then, or was about reading the clipboard without relying on a JS event. The way it works "now" is just how it makes sense, and hopefully limitations stay security wise (not being able to read clipboard data without my interaction).

EA117 wrote: ↑
Thu Jan 10, 2019 3:19 pm
My expectation is that stackoverflow.com description cited is from someone who actually attempted to copy & paste a file from their desktop
I do understand the difference (like sending file links/shortcuts instead of the actual files thru e-mails, because it makes more "sense" filesize wise for less savvy people). Since it was worded "picture from clipboard" I didn't think so low that a mere file(name) could have been meant.

EA117 wrote: ↑
Thu Jan 10, 2019 3:19 pm
There isn't even a plain text rendering of the file path available from the clipboard, which you can prove by trying to Paste that "file" into Notepad.
No: that's because Notepad wants text only. If it would also consider invoking DragQueryFile() upon CF_HDROP it could list all files and paths. They are available, and an internet browser hopefully never does this on purpose just to turn a file drag handle into text. But this is going abroad, especially since I never wanted files, but instead images, too.
The worst thing about censorship is β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
Affin wrote: ↑
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

User avatar
EA117
Registered User
Posts: 607
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Allow to paste IMGs from the clipboard as attachments

Post by EA117 » Thu Jan 10, 2019 6:35 pm

AmigoJack wrote: ↑
Thu Jan 10, 2019 4:40 pm
EA117 wrote: ↑
Thu Jan 10, 2019 3:19 pm
There isn't even a plain text rendering of the file path available from the clipboard, which you can prove by trying to Paste that "file" into Notepad.
No: that's because Notepad wants text only. If it would also consider invoking DragQueryFile() upon CF_HDROP it could list all files and paths.
Yep; I don't think we're disagreeing, then. The discussion was just of what data format is actually available in the clipboard. Neither "plain text" nor "image" are the kind of data formats SHELL32 has made available to the clipboard in the described scenario. Which is why pasting to an application that supports reading text data from the clipboard (such as a phpBB edit field in a browser, or Notepad) wouldn't receive anything in this scenario (because no CF_TEXT data), and why a phpBB edit field enhanced with Senky's extension wouldn't receive anything in this scenario (because no CF_DIB data).

SHELL32 actually does have the choice to provide a CF_TEXT version of the same data it's simultaneously providing via CF_HDROP and other formats. But SHELL32 doesn't do that, which is what's behind the statement "there isn't even a plain text rendering of the file available", speaking from the clipboard's perspective. Meaning the ability to paste a text version of the file path could have already worked in all places that support pasting text data; without those applications having to be modified to interpret CF_HDROP first. But SHELL32 chose not to do that.
AmigoJack wrote: ↑
Thu Jan 10, 2019 4:40 pm
Since it was worded "picture from clipboard" I didn't think so low that a mere file(name) could have been meant.
The original poster's subject line is what requested "picture from clipboard." It's the person who provided links to the Javascript clipboard event code who included the caveat of "it only works within the browser", and specifically asserted "It doesn't work when you copy image from desktop." It's specifically their use of the word "desktop" that made my interpretation of "he's not talking about pasting out of other applications."
AmigoJack wrote: ↑
Thu Jan 10, 2019 4:40 pm
Maybe the limitation being discussed 2.5 years ago really existed back then, or was about reading the clipboard without relying on a JS event.
Agreed. Since they didn't cite what platform their assertion was in reference to even back then, we can't even test or rule out that some browser's Javascript event implementation might have been written to only deal in data the web browser application itself had generated. i.e. Does not support reading clipboard data from the actual Windows / platform clipboard, even though "it does support cut and paste" (within the browser only) through the Javascript events.

Thankfully it's not the behavior I've seen in Firefox, Chrome or Edge on current Windows platforms. They all supported reading data from the Windows platform clipboard.

Post Reply

Return to β€œphpBB Ideas”