jnlittle's avatar

Summernote for formatted posts dealing with embedded images

Working on a blog with formatted posts and using Summernote. On first blush it looks create allowing for drag and drop composition of images within a post and the flexibility of placing images within the layout of the post.

I use Intervention Image with ImageMagick to scrape the embedded images data-urls from the post content. Resize, rename, place in image dir on server, and return image urls to inject back into post content as links before storing in database.

Seemed too good to be true, and it was. In testing I found the flaw that I suspected would be an issue. Having images base64 encoded exacerbates the issue of large images and server posted data limits. Trying a couple of large images causes the dreaded Illuminate \ Http \ Exceptions \ PostTooLargeException error.

Can use a regular file upload, but then you lose layout flexibility within the posts, or having more than one image. No way to convert data-urls to file-uploads client-side do to security restrictions in JavaScript.

How have others implemented formatted blogs?

0 likes
0 replies

Please or to participate in this conversation.