MyBB Community Forums

Full Version: Feature: copy/paste image in-line in a post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Related:
https://github.com/mybb/mybb/issues/2440
https://community.mybb.com/thread-194877.html

(2019-09-30, 12:13 PM)noyle Wrote: [ -> ]Well, just make my mind clear here:
  • For an existing external/remote image, the editor should be able to get the link of user pasted image, and insert a [img]https://[/img] like text into post content.
  • For a local image, the editor will just insert the image content as encoded text, and MyBB will do some dirty job like save this image as an attachment file upon processing post submitting.

Makes sense if we expect a future drag-and-drop feature (within the editor) to upload an attachment; same could work for pasted content. In this case support for data URIs may be unnecessary.

Limits on mybb_posts.message length and data bloat (with attachments in database tables that could be stored in files instead, potentially taking advantage of MyBB's CDN support) might make this complicated.
Quoting my Discord message(s):

Quote:I've had a read of the thread, here are some quick thoughts:
  • In an ideal world, copy and paste and drag and drop would lead to attachment uploads, which would allow the use of the forum's CDN if configured (and HTTPS, if configured)
  • Currently SCEditor only supports data URIs. We could always take these data URIs and create attachment files based upon them, though we'd have to assign random file names. We already have AJAX support for attachment uploads in 1.8 so this shouldn't be too big of a deal I don't think...
  • Message length is definitely a concern
  • The above about converting data images to attachments falls down when it comes to PMs - 1.8's PM system doesn't support attachments for PMs as far as I remember. This was a planned feature for 2.0, would also make sense for 1.9

Note also that the PR that I merged yesterday needs some changes made to check for valid data URIs - I plan to open a new PR tonight to make that change. However, if we decide that the concern relating to message length is serious enough, we may end up reverting the previous PR.
(2019-09-30, 06:59 PM)Euan T Wrote: [ -> ](...)
Note also that the PR that I merged yesterday needs some changes made to check for valid data URIs - I plan to open a new PR tonight to make that change. However, if we decide that the concern relating to message length is serious enough, we may end up reverting the previous PR.

I was thinking about the same thing days ago but looks like only a base64 decode will check the sequence's validity, regex can't do this.

Well, just make my concerns more clearly here, priority high -> low:
  • concept: is it ideal to or should we encourage users at MyBB's core level for binary data to be stored in such message data field which is of type TEXT in database.
  • security & management: user-inputted data URI can be any kind of binary data, not limited to images, thus harmful data as well as wrongly inputted data sequence might lead to security concerns and will make post content management more difficult from forum admins' perspective to current MyBB's code organization.
  • limitation: by database table's column, currently TEXT (65535 bytes) for message field.
  • capability: of parsing data URI code in post/PM, its not really a big problem for implementing such support, recent PRs just achieved this.

However, it's users' will to insert any data URI in their post content, and it will be the forum admins' decision to support such data to be interpreted.

Actually, the original issue comes from SCEditor's or any WYGIWYS editor's feature of parsing a data URI image, but MyBB's lacking of the ability to deal with such data, neither before and after a post being submitted nor a post being displayed. Solution would be simple, any one of following way is OK:
  • remove/disable features in editor which are not natively supported by MyBB;
  • modify the editor's behavior of handling images/etc., to make it accordance with MyBB's way of handling images/attachments/etc.;
  • add support to all features of editor to MyBB, either by extra plugins or baking into MyBB's core.
(2019-09-29, 03:55 PM)effone Wrote: [ -> ]MyBB parser was not supporting copy/paste images in post as of now.
Like couple of days back we have implemented the support and will be part of v. 1.8.22

https://github.com/mybb/mybb/pull/3808

damn i have v 1.8.21 and i need this feature

seems like i need to update my version

i have some customization and i always forget what to change manually
(2019-09-30, 02:24 PM)Devilshakerz Wrote: [ -> ]Related:
https://github.com/mybb/mybb/issues/2440
https://community.mybb.com/thread-194877.html

(2019-09-30, 12:13 PM)noyle Wrote: [ -> ]Well, just make my mind clear here:
  • For an existing external/remote image, the editor should be able to get the link of user pasted image, and insert a [img]https://[/img] like text into post content.
  • For a local image, the editor will just insert the image content as encoded text, and MyBB will do some dirty job like save this image as an attachment file upon processing post submitting.

Makes sense if we expect a future drag-and-drop feature (within the editor) to upload an attachment; same could work for pasted content. In this case support for data URIs may be unnecessary.

Limits on mybb_posts.message length and data bloat (with attachments in database tables that could be stored in files instead, potentially taking advantage of MyBB's CDN support) might make this complicated.

(2019-09-30, 06:59 PM)Euan T Wrote: [ -> ]Quoting my Discord message(s):

Quote:I've had a read of the thread, here are some quick thoughts:
  • In an ideal world, copy and paste and drag and drop would lead to attachment uploads, which would allow the use of the forum's CDN if configured (and HTTPS, if configured)
  • Currently SCEditor only supports data URIs. We could always take these data URIs and create attachment files based upon them, though we'd have to assign random file names. We already have AJAX support for attachment uploads in 1.8 so this shouldn't be too big of a deal I don't think...
  • Message length is definitely a concern
  • The above about converting data images to attachments falls down when it comes to PMs - 1.8's PM system doesn't support attachments for PMs as far as I remember. This was a planned feature for 2.0, would also make sense for 1.9

Note also that the PR that I merged yesterday needs some changes made to check for valid data URIs - I plan to open a new PR tonight to make that change. However, if we decide that the concern relating to message length is serious enough, we may end up reverting the previous PR.

(2019-10-01, 05:15 AM)noyle Wrote: [ -> ]
(2019-09-30, 06:59 PM)Euan T Wrote: [ -> ](...)
Note also that the PR that I merged yesterday needs some changes made to check for valid data URIs - I plan to open a new PR tonight to make that change. However, if we decide that the concern relating to message length is serious enough, we may end up reverting the previous PR.

I was thinking about the same thing days ago but looks like only a base64 decode will check the sequence's validity, regex can't do this.

Well, just make my concerns more clearly here, priority high -> low:
  • concept: is it ideal to or should we encourage users at MyBB's core level for binary data to be stored in such message data field which is of type TEXT in database.
  • security & management: user-inputted data URI can be any kind of binary data, not limited to images, thus harmful data as well as wrongly inputted data sequence might lead to security concerns and will make post content management more difficult from forum admins' perspective to current MyBB's code organization.
  • limitation: by database table's column, currently TEXT (65535 bytes) for message field.
  • capability: of parsing data URI code in post/PM, its not really a big problem for implementing such support, recent PRs just achieved this.

However, it's users' will to insert any data URI in their post content, and it will be the forum admins' decision to support such data to be interpreted.

Actually, the original issue comes from SCEditor's or any WYGIWYS editor's feature of parsing a data URI image, but MyBB's lacking of the ability to deal with such data, neither before and after a post being submitted nor a post being displayed. Solution would be simple, any one of following way is OK:
  • remove/disable features in editor which are not natively supported by MyBB;
  • modify the editor's behavior of handling images/etc., to make it accordance with MyBB's way of handling images/attachments/etc.;
  • add support to all features of editor to MyBB, either by extra plugins or baking into MyBB's core.


hello. I have updated my forum to latest version but still copy paste image not working? how to make it work?

https://forum.pokemonpets.com/

https://forum.monstermmorpg.com/
^ it is not added in MyBB 1.8.22 ; expected to be added in a forthcoming version
someone posted this as solution but not working

https://github.com/mybb/mybb/issues/4078...-651064741
Pages: 1 2